PHP Класс eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway\DoctrineDatabase

Наследование: extends eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$handler eZ\Publish\Core\Persistence\Database\DatabaseHandler Database handler.

Открытые методы

Метод Описание
__construct ( eZ\Publish\Core\Persistence\Database\DatabaseHandler $handler ) Construct from database handler.
addPolicy ( mixed $roleId, eZ\Publish\SPI\Persistence\User\Policy $policy ) : eZ\Publish\SPI\Persistence\User\Policy Adds a policy to a role.
addPolicyLimitations ( integer $policyId, array $limitations ) Adds limitations to an existing policy.
createRole ( eZ\Publish\SPI\Persistence\User\Role $role ) : eZ\Publish\SPI\Persistence\User\Role Create new role.
deleteRole ( mixed $roleId, integer $status = Role::STATUS_DEFINED ) Delete the specified role (draft).
loadPoliciesByUserId ( mixed $userId ) : UserPolicy[] Returns the user policies associated with the user.
loadRole ( mixed $roleId, integer $status = Role::STATUS_DEFINED ) : array Loads a specified role by id.
loadRoleAssignment ( mixed $roleAssignmentId ) : array Loads role assignment for specified assignment ID.
loadRoleAssignmentsByGroupId ( mixed $groupId, boolean $inherited = false ) : array Loads role assignments for specified content ID.
loadRoleAssignmentsByRoleId ( mixed $roleId ) : array Loads role assignments for given role ID.
loadRoleByIdentifier ( string $identifier, integer $status = Role::STATUS_DEFINED ) : array Loads a specified role by $identifier.
loadRoleDraftByRoleId ( mixed $roleId ) : array Loads a role draft by the original role ID.
loadRoles ( integer $status = Role::STATUS_DEFINED ) : array Loads all roles.
loadRolesForContentObjects ( array $contentIds, integer $status = Role::STATUS_DEFINED ) : array Loads all roles associated with the given content objects.
publishRoleDraft ( mixed $roleDraftId, mixed | null $originalRoleId = null ) Publish the specified role draft.
removePolicy ( mixed $policyId ) Removes a policy from a role.
removePolicyLimitations ( mixed $policyId ) Remove all limitations for a policy.
updateRole ( eZ\Publish\SPI\Persistence\User\RoleUpdateStruct $role ) : array Update role (draft).

Защищенные методы

Метод Описание
fetchUserGroups ( integer $userId ) : array Fetch all group IDs the user belongs to.

Описание методов

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

Construct from database handler.
public __construct ( eZ\Publish\Core\Persistence\Database\DatabaseHandler $handler )
$handler eZ\Publish\Core\Persistence\Database\DatabaseHandler

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

Adds a policy to a role.
public addPolicy ( mixed $roleId, eZ\Publish\SPI\Persistence\User\Policy $policy ) : eZ\Publish\SPI\Persistence\User\Policy
$roleId mixed
$policy eZ\Publish\SPI\Persistence\User\Policy
Результат eZ\Publish\SPI\Persistence\User\Policy

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

Adds limitations to an existing policy.
public addPolicyLimitations ( integer $policyId, array $limitations )
$policyId integer
$limitations array

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

Create new role.
public createRole ( eZ\Publish\SPI\Persistence\User\Role $role ) : eZ\Publish\SPI\Persistence\User\Role
$role eZ\Publish\SPI\Persistence\User\Role
Результат eZ\Publish\SPI\Persistence\User\Role

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

If it's not a draft, the role assignments will also be deleted.
public deleteRole ( mixed $roleId, integer $status = Role::STATUS_DEFINED )
$roleId mixed
$status integer One of Role::STATUS_DEFINED|Role::STATUS_DRAFT

fetchUserGroups() защищенный Метод

This method will return Content ids of all ancestor Locations for the given $userId. Note that not all of these might be used as user groups, but we will need to check all of them.
protected fetchUserGroups ( integer $userId ) : array
$userId integer
Результат array

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

Returns the user policies associated with the user.
public loadPoliciesByUserId ( mixed $userId ) : UserPolicy[]
$userId mixed
Результат UserPolicy[]

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

Loads a specified role by id.
public loadRole ( mixed $roleId, integer $status = Role::STATUS_DEFINED ) : array
$roleId mixed
$status integer One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
Результат array

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

Loads role assignment for specified assignment ID.
public loadRoleAssignment ( mixed $roleAssignmentId ) : array
$roleAssignmentId mixed
Результат array

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

Loads role assignments for specified content ID.
public loadRoleAssignmentsByGroupId ( mixed $groupId, boolean $inherited = false ) : array
$groupId mixed
$inherited boolean
Результат array

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

Loads role assignments for given role ID.
public loadRoleAssignmentsByRoleId ( mixed $roleId ) : array
$roleId mixed
Результат array

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

Loads a specified role by $identifier.
public loadRoleByIdentifier ( string $identifier, integer $status = Role::STATUS_DEFINED ) : array
$identifier string
$status integer One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
Результат array

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

Loads a role draft by the original role ID.
public loadRoleDraftByRoleId ( mixed $roleId ) : array
$roleId mixed ID of the role the draft was created from.
Результат array

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

Loads all roles.
public loadRoles ( integer $status = Role::STATUS_DEFINED ) : array
$status integer One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
Результат array

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

Loads all roles associated with the given content objects.
public loadRolesForContentObjects ( array $contentIds, integer $status = Role::STATUS_DEFINED ) : array
$contentIds array
$status integer One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
Результат array

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

If the draft was created from an existing role, published version will take the original role ID.
public publishRoleDraft ( mixed $roleDraftId, mixed | null $originalRoleId = null )
$roleDraftId mixed
$originalRoleId mixed | null ID of role the draft was created from. Will be null if the role draft was completely new.

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

Removes a policy from a role.
public removePolicy ( mixed $policyId )
$policyId mixed

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

Remove all limitations for a policy.
public removePolicyLimitations ( mixed $policyId )
$policyId mixed

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

Will not throw anything if location id is invalid.
public updateRole ( eZ\Publish\SPI\Persistence\User\RoleUpdateStruct $role ) : array
$role eZ\Publish\SPI\Persistence\User\RoleUpdateStruct
Результат array

Описание свойств

$handler защищенное свойство

Database handler.
protected DatabaseHandler,eZ\Publish\Core\Persistence\Database $handler
Результат eZ\Publish\Core\Persistence\Database\DatabaseHandler