Beispiel #1
0
 public function getRoles()
 {
     if (!($id = $this->id())) {
         return array('anonymous');
     }
     if ($this->roles !== null) {
         return $this->roles;
     }
     $user_role_select = User_Role::select()->setCols('role_id')->where('user_id = ?', $id)->where('expire_time is null or expire_time > now()');
     return $this->roles = Role::select()->setCols('name')->whereIn('id', $user_role_select)->execute()->getCols();
 }