Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 17 |
| ModuleServices | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
42.00 | |
0.00% |
0 / 17 |
| __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 |
|||
| getAllModules | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
| <?php | |
| namespace com\linways\core\ams\professional\service; | |
| use com\linways\core\ams\professional\exception\ProfessionalException; | |
| /** | |
| * | |
| * @Date 28/10/20 | |
| */ | |
| class ModuleServices extends BaseService | |
| { | |
| /** | |
| * @var null | |
| */ | |
| private static $_instance = null; | |
| /** | |
| * LectureHourService constructor. | |
| */ | |
| private function __construct() | |
| { | |
| } | |
| /** | |
| * prevent cloning | |
| */ | |
| private function __clone() | |
| { | |
| } | |
| /** | |
| * @return ModuleServices|null | |
| */ | |
| public static function getInstance() | |
| { | |
| if (!is_object(self::$_instance)) | |
| self::$_instance = new self(); | |
| return self::$_instance; | |
| } | |
| /** | |
| * @return Object | |
| * @throws ProfessionalException | |
| */ | |
| public function getAllModules() | |
| { | |
| $sql = "SELECT * FROM modules WHERE is_active=1 ORDER BY priority"; | |
| try { | |
| return $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| } | |
| } |