Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 31 |
| ExatFormService | |
0.00% |
0 / 1 |
|
0.00% |
0 / 5 |
72.00 | |
0.00% |
0 / 31 |
| __construct | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 2 |
|||
| __clone | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 2 |
|||
| getInstance | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 5 |
|||
| getFormCodeByFormId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
| getStaffDetailsByEntityId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
| <?php | |
| namespace com\linways\core\ams\professional\service\exat2; | |
| use com\linways\base\exception\CoreException; | |
| use com\linways\base\util\RequestUtil; | |
| use com\linways\core\ams\professional\exception\ProfessionalException; | |
| use com\linways\core\ams\professional\mapper\DepartmentServiceMapper; | |
| use com\linways\core\ams\professional\dto\Subject; | |
| use com\linways\core\ams\professional\request\api\GetAllDepartmentsRequest; | |
| use com\linways\core\ams\professional\request\SearchDepartmentRequest; | |
| use com\linways\core\ams\professional\service\BaseService; | |
| class ExatFormService extends BaseService | |
| { | |
| // /Condition 1 - Presence of a static member variable | |
| private static $_instance = null; | |
| private $mapper = []; | |
| // /Condition 2 - Locked down the constructor | |
| private function __construct() | |
| { | |
| } | |
| // Prevent any oustide instantiation of this class | |
| // /Condition 3 - Prevent any object or instance of that class to be cloned | |
| private function __clone() | |
| { | |
| } | |
| // Prevent any copy of this object | |
| // /Condition 4 - Have a single globally accessible static method | |
| public static function getInstance() | |
| { | |
| if (!is_object(self::$_instance)) // or if( is_null(self::$_instance) ) or if( self::$_instance == null ) | |
| self::$_instance = new self(); | |
| return self::$_instance; | |
| } | |
| public function getFormCodeByFormId($request) | |
| { | |
| $formCode = null; | |
| $sql = "SELECT code | |
| FROM exat_form where id='$request'"; | |
| try { | |
| $formCode = $this->executeQueryForObject($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $formCode; | |
| } | |
| public function getStaffDetailsByEntityId($request) | |
| { | |
| $staffName = null; | |
| $sql = "SELECT staffName | |
| FROM staffaccounts where staffID='$request'"; | |
| try { | |
| $staffName = $this->executeQueryForObject($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $staffName->staffName; | |
| } | |
| } |