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