eZPublishCommunityProject  2013.9
eZ\Publish\Core\Persistence\Legacy\User\Handler Class Reference

Storage Engine handler for user module. More...

+ Inheritance diagram for eZ\Publish\Core\Persistence\Legacy\User\Handler:
+ Collaboration diagram for eZ\Publish\Core\Persistence\Legacy\User\Handler:

Public Member Functions

 __construct (Gateway $userGateway, RoleGateway $roleGateway, Mapper $mapper, LimitationConverter $limitationConverter)
 Construct from userGateway. More...
 
 addPolicy ($roleId, Policy $policy)
 Adds a policy to a role. More...
 
 assignRole ($contentId, $roleId, array $limitation=null)
 Assigns role to a user or user group with given limitations. More...
 
 create (User $user)
 Create a user. More...
 
 createRole (Role $role)
 Create new role. More...
 
 delete ($userId)
 Delete user with the given ID. More...
 
 deleteRole ($roleId)
 Delete the specified role. More...
 
 load ($userId)
 Loads user with user ID. More...
 
 loadByEmail ($email)
 Loads user(s) with user email. More...
 
 loadByLogin ($login)
 Loads user with user login. More...
 
 loadPoliciesByUserId ($userId)
 Returns the user policies associated with the user (including inherited policies from user groups) More...
 
 loadRole ($roleId)
 Loads a specified role by $roleId. More...
 
 loadRoleAssignmentsByGroupId ($groupId, $inherit=false)
 Loads roles assignments to a user/group. More...
 
 loadRoleAssignmentsByRoleId ($roleId)
 Loads roles assignments Role. More...
 
 loadRoleByIdentifier ($identifier)
 Loads a specified role by $identifier. More...
 
 loadRoles ()
 Loads all roles. More...
 
 removePolicy ($roleId, $policyId)
 Removes a policy from a role. More...
 
 unAssignRole ($contentId, $roleId)
 Un-assign a role. More...
 
 update (User $user)
 Update the user information specified by the user struct. More...
 
 updatePolicy (Policy $policy)
 Update a policy. More...
 
 updateRole (RoleUpdateStruct $role)
 Update role. More...
 

Protected Attributes

 $limitationConverter
 
 $mapper
 
 $roleGateway
 
 $userGateway
 

Detailed Description

Storage Engine handler for user module.

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\User\Handler::__construct ( Gateway  $userGateway,
RoleGateway  $roleGateway,
Mapper  $mapper,
LimitationConverter  $limitationConverter 
)

Construct from userGateway.

Parameters
\eZ\Publish\Core\Persistence\Legacy\User\Gateway$userGateway
\eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway$roleGateway
\eZ\Publish\Core\Persistence\Legacy\User\Mapper$mapper
\eZ\Publish\Core\Persistence\Legacy\User\Role\LimitationConverter$limitationConverter

Member Function Documentation

eZ\Publish\Core\Persistence\Legacy\User\Handler::addPolicy (   $roleId,
Policy  $policy 
)

Adds a policy to a role.

Parameters
mixed$roleId
\eZ\Publish\SPI\Persistence\User\Policy$policy
Returns

Implements eZ\Publish\SPI\Persistence\User\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\User\Handler\createRole().

eZ\Publish\Core\Persistence\Legacy\User\Handler::assignRole (   $contentId,
  $roleId,
array  $limitation = null 
)

Assigns role to a user or user group with given limitations.

The limitation array looks like: array( 'Subtree' => array( '/1/2/', '/1/4/', ), 'Foo' => array( 'Bar' ), … )

Where the keys are the limitation identifiers, and the respective values are an array of limitation values. The limitation parameter is optional.

Parameters
mixed$contentIdThe groupId or userId to assign the role to.
mixed$roleId
array$limitation

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::create ( User  $user)

Create a user.

The User struct used to create the user will contain an ID which is used to reference the user.

Parameters
\eZ\Publish\SPI\Persistence\User$user
Returns

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::createRole ( Role  $role)

Create new role.

Parameters
\eZ\Publish\SPI\Persistence\User\Role$role
Returns

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::delete (   $userId)

Delete user with the given ID.

Parameters
mixed$userId

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::deleteRole (   $roleId)

Delete the specified role.

Parameters
mixed$roleId

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::load (   $userId)

Loads user with user ID.

Parameters
mixed$userId
Returns

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::loadByEmail (   $email)

Loads user(s) with user email.

As earlier eZ Publish versions supported several users having same email (ini config), this function may return several users.

Parameters
string$email
Returns
[]

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::loadByLogin (   $login)

Loads user with user login.

Parameters
string$login
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf user is not found
Returns

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::loadPoliciesByUserId (   $userId)

Returns the user policies associated with the user (including inherited policies from user groups)

Parameters
mixed$userId
Returns
[]

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::loadRole (   $roleId)

Loads a specified role by $roleId.

Parameters
mixed$roleId
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf role is not found
Returns

Implements eZ\Publish\SPI\Persistence\User\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\User\Handler\deleteRole().

eZ\Publish\Core\Persistence\Legacy\User\Handler::loadRoleAssignmentsByGroupId (   $groupId,
  $inherit = false 
)

Loads roles assignments to a user/group.

Role Assignments with same roleId and limitationIdentifier will be merged together into one.

Parameters
mixed$groupIdIn legacy storage engine this is the content object id roles are assigned to in ezuser_role. By the nature of legacy this can currently also be used to get by $userId.
boolean$inheritIf true also return inherited role assignments from user groups.
Returns
[]

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::loadRoleAssignmentsByRoleId (   $roleId)

Loads roles assignments Role.

Role Assignments with same roleId and limitationIdentifier will be merged together into one.

Parameters
mixed$roleId
Returns
[]

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::loadRoleByIdentifier (   $identifier)

Loads a specified role by $identifier.

Parameters
string$identifier
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf role is not found
Returns

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::loadRoles ( )

Loads all roles.

Returns
[]

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::removePolicy (   $roleId,
  $policyId 
)

Removes a policy from a role.

Parameters
mixed$roleId
mixed$policyId
Returns
void

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::unAssignRole (   $contentId,
  $roleId 
)

Un-assign a role.

Parameters
mixed$contentIdThe user or user group Id to un-assign the role from.
mixed$roleId

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::update ( User  $user)

Update the user information specified by the user struct.

Parameters
\eZ\Publish\SPI\Persistence\User$user

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::updatePolicy ( Policy  $policy)

Update a policy.

Replaces limitations values with new values.

Parameters
\eZ\Publish\SPI\Persistence\User\Policy$policy

Implements eZ\Publish\SPI\Persistence\User\Handler.

eZ\Publish\Core\Persistence\Legacy\User\Handler::updateRole ( RoleUpdateStruct  $role)

Update role.

Parameters
\eZ\Publish\SPI\Persistence\User\RoleUpdateStruct$role

Implements eZ\Publish\SPI\Persistence\User\Handler.

Member Data Documentation

eZ\Publish\Core\Persistence\Legacy\User\Handler::$limitationConverter
protected
eZ\Publish\Core\Persistence\Legacy\User\Handler::$mapper
protected
eZ\Publish\Core\Persistence\Legacy\User\Handler::$roleGateway
protected
eZ\Publish\Core\Persistence\Legacy\User\Handler::$userGateway
protected

The documentation for this class was generated from the following file: