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

loadRoleDraftByRoleId() public method

Loads a role draft by the original role ID.
public loadRoleDraftByRoleId ( mixed $roleId ) : eZ\Publish\SPI\Persistence\User\Role
$roleId mixed ID of the role the draft was created from.
return eZ\Publish\SPI\Persistence\User\Role
    public function loadRoleDraftByRoleId($roleId)
    {
        $data = $this->roleGateway->loadRoleDraftByRoleId($roleId);
        if (empty($data)) {
            throw new RoleNotFound($roleId, Role::STATUS_DRAFT);
        }
        $role = $this->mapper->mapRole($data);
        foreach ($role->policies as $policy) {
            $this->limitationConverter->toSPI($policy);
        }
        return $role;
    }