示例#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();
 }
示例#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;
 }
示例#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);
 }