Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 27 |
| TileMenuService | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
90.00 | |
0.00% |
0 / 27 |
| __construct | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| __clone | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| getInstance | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 5 |
|||
| getTileMenuByType | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 20 |
|||
| <?php | |
| namespace com\linways\core\ams\professional\service; | |
| use com\linways\core\ams\professional\dto\SubmenuTileView; | |
| use com\linways\core\ams\professional\util\tilemenu\GraphUtil; | |
| use com\linways\core\ams\professional\util\tilemenu\AttendanceReportsUtil; | |
| use com\linways\core\ams\professional\util\tilemenu\ExamReportsUtil; | |
| use com\linways\core\ams\professional\util\tilemenu\InternalResultAnalysisUtil; | |
| // use com\linways\core\ams\professional\util\tilemenu\UniversityExamUtil; | |
| class TileMenuService 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; | |
| } | |
| /** | |
| * @param string $type; | |
| */ | |
| public function getTileMenuByType ( $type ) | |
| { | |
| $tileMenu = []; | |
| switch ( $type ) { | |
| case 'ATTENDANCE': | |
| $tileMenu = AttendanceReportsUtil::getAttendanceMenu(); | |
| break; | |
| case 'GRAPH': | |
| $tileMenu = GraphUtil::getGraphMenu(); | |
| break; | |
| case 'EXAM': | |
| $tileMenu = ExamReportsUtil::getExamMenu(); | |
| break; | |
| case 'INTERNALRESULTANALYSIS': | |
| $tileMenu = InternalResultAnalysisUtil::getInternalResultAnalysisMenu(); | |
| break; | |
| // case 'UNIVERSITYEXAM': | |
| // $tileMenu = UniversityExamUtil::getUniversityExamMenu(); | |
| // break; | |
| default: | |
| # code... | |
| break; | |
| } | |
| return $tileMenu; | |
| } | |
| } | |
| ?> |