Class

eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway\DoctrineDatabase

class DoctrineDatabase extends Gateway

User Role gateway implementation using the Doctrine database.

Methods

Role createRole(Role $role)

Create new role.

array loadRole(mixed $roleId, int $status = Role::STATUS_DEFINED)

Loads a specified role by id.

array loadRoleByIdentifier(string $identifier, int $status = Role::STATUS_DEFINED)

Loads a specified role by $identifier.

array loadRoleDraftByRoleId(mixed $roleId)

Loads a role draft by the original role ID.

array loadRoles(int $status = Role::STATUS_DEFINED)

Loads all roles.

array loadRolesForContentObjects(array $contentIds, int $status = Role::STATUS_DEFINED)

Loads all roles associated with the given content objects.

array loadRoleAssignment(mixed $roleAssignmentId)

Loads role assignment for specified assignment ID.

array loadRoleAssignmentsByGroupId(mixed $groupId, bool $inherited = false)

Loads role assignments for specified content ID.

array loadRoleAssignmentsByRoleId(mixed $roleId)

Loads role assignments for given role ID.

UserPolicy[] loadPoliciesByUserId(mixed $userId)

Returns the user policies associated with the user.

array updateRole(RoleUpdateStruct $role)

Update role (draft).

deleteRole(mixed $roleId, int $status = Role::STATUS_DEFINED)

Delete the specified role (draft).

publishRoleDraft(mixed $roleDraftId, mixed|null $originalRoleId = null)

Publish the specified role draft.

Policy addPolicy(mixed $roleId, Policy $policy)

Adds a policy to a role.

addPolicyLimitations(int $policyId, array $limitations)

Adds limitations to an existing policy.

removePolicy(mixed $policyId)

Removes a policy from a role.

removePolicyLimitations(mixed $policyId)

Remove all limitations for a policy.

__construct(DatabaseHandler $handler)

Construct from database handler.

Details

at line 46
public Role createRole(Role $role)

Create new role.

Parameters

Role $role

Return Value

Role

at line 100
public array loadRole(mixed $roleId, int $status = Role::STATUS_DEFINED)

Loads a specified role by id.

Parameters

mixed $roleId
int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

Return Value

array

at line 169
public array loadRoleByIdentifier(string $identifier, int $status = Role::STATUS_DEFINED)

Loads a specified role by $identifier.

Parameters

string $identifier
int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

Return Value

array

at line 237
public array loadRoleDraftByRoleId(mixed $roleId)

Loads a role draft by the original role ID.

Parameters

mixed $roleId ID of the role the draft was created from.

Return Value

array

at line 292
public array loadRoles(int $status = Role::STATUS_DEFINED)

Loads all roles.

Parameters

int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

Return Value

array

at line 360
public array loadRolesForContentObjects(array $contentIds, int $status = Role::STATUS_DEFINED)

Loads all roles associated with the given content objects.

Parameters

array $contentIds
int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

Return Value

array

at line 438
public array loadRoleAssignment(mixed $roleAssignmentId)

Loads role assignment for specified assignment ID.

Parameters

mixed $roleAssignmentId

Return Value

array

at line 470
public array loadRoleAssignmentsByGroupId(mixed $groupId, bool $inherited = false)

Loads role assignments for specified content ID.

Parameters

mixed $groupId
bool $inherited

Return Value

array

at line 514
public array loadRoleAssignmentsByRoleId(mixed $roleId)

Loads role assignments for given role ID.

Parameters

mixed $roleId

Return Value

array

at line 545
public UserPolicy[] loadPoliciesByUserId(mixed $userId)

Returns the user policies associated with the user.

Parameters

mixed $userId

Return Value

UserPolicy[]

at line 632
public array updateRole(RoleUpdateStruct $role)

Update role (draft).

Will not throw anything if location id is invalid.

Parameters

RoleUpdateStruct $role

Return Value

array

at line 663
public deleteRole(mixed $roleId, int $status = Role::STATUS_DEFINED)

Delete the specified role (draft).

If it's not a draft, the role assignments will also be deleted.

Parameters

mixed $roleId
int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

at line 713
public publishRoleDraft(mixed $roleDraftId, mixed|null $originalRoleId = null)

Publish the specified role draft.

If the draft was created from an existing role, published version will take the original role ID.

Parameters

mixed $roleDraftId
mixed|null $originalRoleId ID of role the draft was created from. Will be null if the role draft was completely new.

at line 772
public Policy addPolicy(mixed $roleId, Policy $policy)

Adds a policy to a role.

Parameters

mixed $roleId
Policy $policy

Return Value

Policy

at line 817
public addPolicyLimitations(int $policyId, array $limitations)

Adds limitations to an existing policy.

Parameters

int $policyId
array $limitations

at line 863
public removePolicy(mixed $policyId)

Removes a policy from a role.

Parameters

mixed $policyId

at line 884
public removePolicyLimitations(mixed $policyId)

Remove all limitations for a policy.

Parameters

mixed $policyId

at line 34
public __construct(DatabaseHandler $handler)

Construct from database handler.

Parameters

DatabaseHandler $handler