Example #1
0
 /**
  * @param bool $full
  *
  * @return Role|false
  */
 public function findSingle($full = false)
 {
     $result = parent::findSingle();
     if ($result) {
         $role = new Role($result);
         if ($full === true) {
             $repo = new PermissionRepository($this->db);
             $role->setPermissions($repo->where('role_id', '=', $role->getId())->order('name', 'ASC')->find());
         }
         return $role;
     } else {
         return false;
     }
 }