loadRoles() abstract public method

Loads all roles.
abstract public loadRoles ( integer $status = Role::STATUS_DEFINED ) : array
$status integer One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
return array
 /**
  * Loads all roles.
  *
  * @param int $status One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
  *
  * @return array
  */
 public function loadRoles($status = Role::STATUS_DEFINED)
 {
     try {
         return $this->innerGateway->loadRoles();
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }
Esempio n. 2
0
 /**
  * Loads all roles.
  *
  * @return \eZ\Publish\SPI\Persistence\User\Role[]
  */
 public function loadRoles()
 {
     $data = $this->roleGateway->loadRoles();
     $roles = $this->mapper->mapRoles($data);
     foreach ($roles as $role) {
         foreach ($role->policies as $policy) {
             $this->limitationConverter->toSPI($policy);
         }
     }
     return $roles;
 }