eZ\Publish\Core\REST\Server\Controller\Role::publishRoleDraft PHP Метод

publishRoleDraft() публичный Метод

Publishes a role draft.
public publishRoleDraft ( mixed $roleId ) : PublishedRole
$roleId mixed Original role ID, or ID of the role draft itself
Результат eZ\Publish\Core\REST\Server\Values\PublishedRole
    public function publishRoleDraft($roleId)
    {
        try {
            // First try to load the draft for given role.
            $roleDraft = $this->roleService->loadRoleDraftByRoleId($roleId);
        } catch (NotFoundException $e) {
            // We might want a newly created role, so try to load it by its ID.
            // loadRoleDraft() might throw a NotFoundException (wrong $roleId). If so, let it bubble up.
            $roleDraft = $this->roleService->loadRoleDraft($roleId);
        }
        $this->roleService->publishRoleDraft($roleDraft);
        $role = $this->roleService->loadRole($roleId);
        return new Values\PublishedRole(['role' => new Values\RestRole($role)]);
    }