Exemplo n.º 1
0
 public function getPermissions()
 {
     $q = ORM::select('Bazalt\\Auth\\Model\\Permission p', 'p.id')->innerJoin('Bazalt\\Auth\\Model\\RoleRefPermission rp', ['permission_id', 'p.id'])->where('rp.role_id = ?', $this->id);
     return $q->fetchAll();
 }
Exemplo n.º 2
0
 public static function isSettingValUnique($name, $val)
 {
     $q = ORM::select('Bazalt\\Auth\\Model\\UserSetting s', 'COUNT(*) as count')->where('s.setting = ?', $name)->andWhere('s.value = ?', $val);
     return (double) $q->fetch('stdClass')->count == 0;
 }
Exemplo n.º 3
0
 public static function getCollection()
 {
     $q = ORM::select('Bazalt\\Auth\\Model\\User f')->where('is_deleted = 0')->orderBy('is_active ASC');
     return new \Bazalt\ORM\Collection($q);
 }