Beispiel #1
0
 public static function loadByUserId($userId, $options = [])
 {
     $db = new Util\Data();
     $db->buildQuery('select', self::getList());
     $db->buildQuery('from', 'core_role r');
     $db->buildQuery('join', 'core_user_role ur ON ur.role_id = r.id');
     $db->buildQuery('where', 'ur.user_id = ' . $userId);
     $db->extendQuery($options);
     return self::mapList($db);
 }
Beispiel #2
0
 public static function loadFullComponents($options = [])
 {
     $db = new Util\Data();
     $list = 'component.id AS componentId,
         component.module_id AS componentModuleId,
         CONCAT(module.title, \' - \', component.title) AS componentTitle';
     $db->buildQuery('select', $list);
     $db->buildQuery('from', 'cms_component component');
     $db->buildQuery('join', 'cms_module module ON module.id = component.module_id');
     $db->buildQuery('where', 'component.status = 1');
     $db->buildQuery('where', 'module.status = 1');
     $db->buildQuery('order', 'module.title, component.title');
     $db->extendQuery($options);
     return self::mapList($db);
 }
Beispiel #3
0
 public static function loadAll(array $options = [])
 {
     $db = new Util\Data();
     $db->buildQuery('select', self::getList());
     $db->buildQuery('from', 'core_user `user`');
     $db->extendQuery($options);
     return self::mapList($db);
 }