mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
de60770e74
- removed comments - automatically added issue_id to params, output the id in error messages
35 lines
937 B
PHP
35 lines
937 B
PHP
<?php
|
|
|
|
/**
|
|
* More than one Zweck for incoming
|
|
*/
|
|
class CORE_INOUT_0002 implements IIssueResolvedChecker
|
|
{
|
|
public function checkIfIssueIsResolved($params)
|
|
{
|
|
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
|
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
|
|
|
$this->_ci =& get_instance(); // get code igniter instance
|
|
|
|
$this->_ci->load->model('codex/Bisiozweck_model', 'BisiozweckModel');
|
|
|
|
// get all bisio Zwecke
|
|
$this->_ci->BisiozweckModel->addSelect('1');
|
|
$bisiozweckRes = $this->_ci->BisiozweckModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
|
|
|
if (isError($bisiozweckRes))
|
|
return $bisiozweckRes;
|
|
|
|
if (hasData($bisiozweckRes))
|
|
{
|
|
if (count(getData($bisiozweckRes)) <= 1) // resolved if one bisio Zweck
|
|
return success(true);
|
|
else
|
|
return success(false); // otherwise not resolved
|
|
}
|
|
else
|
|
return success(true); // resolved if no bisio zweck
|
|
}
|
|
}
|