eZ\Publish\Core\Persistence\Legacy\User\Handler::loadRole PHP Method

loadRole() public method

Loads a specified role (draft) by $roleId and $status.
public loadRole ( mixed $roleId, integer $status = Role::STATUS_DEFINED ) : eZ\Publish\SPI\Persistence\User\Role
$roleId mixed
$status integer One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
return eZ\Publish\SPI\Persistence\User\Role
    public function loadRole($roleId, $status = Role::STATUS_DEFINED)
    {
        $data = $this->roleGateway->loadRole($roleId, $status);
        if (empty($data)) {
            throw new RoleNotFound($roleId, $status);
        }
        $role = $this->mapper->mapRole($data);
        foreach ($role->policies as $policy) {
            $this->limitationConverter->toSPI($policy);
        }
        return $role;
    }