Detailed Description
AbstractMapper provides a basic implementation for other mapper classes.
It handles authorization on entity level and calls the lifecycle callbacks of PersistentObject instances. Authorization on attribute level has to be implemented by subclasses.
Definition at line 41 of file AbstractMapper.php.
Public Member Functions | |
__construct (PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ConcurrencyManager $concurrencyManager, EventManager $eventManager) | |
setLogStrategy (OutputStrategy $logStrategy) | |
getTypeDisplayName (Message $message) | |
getTypeDescription (Message $message) | |
hasRelation ($roleName) | |
getRelation ($roleName) | |
getRelationsByType ($type) | |
hasAttribute ($name) | |
getAttribute ($name) | |
getReferences () | |
getAttributeDisplayName ($name, Message $message) | |
getAttributeDescription ($name, Message $message) | |
getProperties () | |
load (ObjectId $oid, $buildDepth=BuildDepth::SINGLE) | |
create ($type, $buildDepth=BuildDepth::SINGLE) | |
save (PersistentObject $object) | |
delete (PersistentObject $object) | |
getOIDs ($type, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null) | |
loadObjects ($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null) | |
loadRelation (array $objects, $role, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null) | |
Public Member Functions inherited from PersistenceMapper | |
getType () | |
getPkNames () | |
getRelations ($hierarchyType='all') | |
getAttributes (array $tags=[], $matchMode='all') | |
isSortable ($roleName=null) | |
getSortkey ($roleName=null) | |
getDefaultOrder ($roleName=null) | |
executeOperation (PersistenceOperation $operation) | |
beginTransaction () | |
commitTransaction () | |
rollbackTransaction () | |
getStatements () | |
Protected Member Functions | |
logAction (PersistentObject $obj) | |
checkAuthorization ($resource, $action) | |
authorizationFailedError ($resource, $action) | |
loadImpl (ObjectId $oid, $buildDepth=BuildDepth::SINGLE) | |
createImpl ($type, $buildDepth=BuildDepth::SINGLE) | |
saveImpl (PersistentObject $object) | |
deleteImpl (PersistentObject $object) | |
getOIDsImpl ($type, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null) | |
loadObjectsImpl ($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null) | |
loadRelationImpl (array $objects, $role, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null) | |
Protected Attributes | |
$persistenceFacade = null | |
$permissionManager = null | |
$concurrencyManager = null | |
$eventManager = null | |
Constructor & Destructor Documentation
◆ __construct()
__construct | ( | PersistenceFacade | $persistenceFacade, |
PermissionManager | $permissionManager, | ||
ConcurrencyManager | $concurrencyManager, | ||
EventManager | $eventManager | ||
) |
Constructor.
- Parameters
-
$persistenceFacade $permissionManager $concurrencyManager $eventManager
Reimplemented in AbstractRDBMapper.
Definition at line 62 of file AbstractMapper.php.
Member Function Documentation
◆ setLogStrategy()
setLogStrategy | ( | OutputStrategy | $logStrategy | ) |
Set the OutputStrategy used for logging persistence actions.
- Parameters
-
$logStrategy
Definition at line 79 of file AbstractMapper.php.
◆ getTypeDisplayName()
getTypeDisplayName | ( | Message | $message | ) |
Implements PersistenceMapper.
Definition at line 86 of file AbstractMapper.php.
◆ getTypeDescription()
getTypeDescription | ( | Message | $message | ) |
Implements PersistenceMapper.
Definition at line 93 of file AbstractMapper.php.
◆ hasRelation()
hasRelation | ( | $roleName | ) |
- See also
- PersistenceMapper::hasRelation()
Implements PersistenceMapper.
Definition at line 100 of file AbstractMapper.php.
◆ getRelation()
getRelation | ( | $roleName | ) |
- See also
- PersistenceMapper::getRelation()
Implements PersistenceMapper.
Definition at line 108 of file AbstractMapper.php.
◆ getRelationsByType()
getRelationsByType | ( | $type | ) |
Implements PersistenceMapper.
Definition at line 118 of file AbstractMapper.php.
◆ hasAttribute()
hasAttribute | ( | $name | ) |
Implements PersistenceMapper.
Definition at line 129 of file AbstractMapper.php.
◆ getAttribute()
getAttribute | ( | $name | ) |
Implements PersistenceMapper.
Definition at line 137 of file AbstractMapper.php.
◆ getReferences()
getReferences | ( | ) |
Implements PersistenceMapper.
Definition at line 147 of file AbstractMapper.php.
◆ getAttributeDisplayName()
getAttributeDisplayName | ( | $name, | |
Message | $message | ||
) |
Implements PersistenceMapper.
Definition at line 155 of file AbstractMapper.php.
◆ getAttributeDescription()
getAttributeDescription | ( | $name, | |
Message | $message | ||
) |
Implements PersistenceMapper.
Definition at line 162 of file AbstractMapper.php.
◆ getProperties()
getProperties | ( | ) |
Implements PersistenceMapper.
Definition at line 169 of file AbstractMapper.php.
◆ load()
load | ( | ObjectId | $oid, |
$buildDepth = BuildDepth::SINGLE |
|||
) |
- See also
- PersistenceMapper::load()
Implements PersistenceMapper.
Definition at line 176 of file AbstractMapper.php.
◆ create()
create | ( | $type, | |
$buildDepth = BuildDepth::SINGLE |
|||
) |
- See also
- PersistenceMapper::create()
Implements PersistenceMapper.
Definition at line 197 of file AbstractMapper.php.
◆ save()
save | ( | PersistentObject | $object | ) |
- See also
- PersistenceMapper::save()
Implements PersistenceMapper.
Definition at line 213 of file AbstractMapper.php.
◆ delete()
delete | ( | PersistentObject | $object | ) |
- See also
- PersistenceMapper::delete()
Implements PersistenceMapper.
Definition at line 271 of file AbstractMapper.php.
◆ getOIDs()
getOIDs | ( | $type, | |
$criteria = null , |
|||
$orderby = null , |
|||
PagingInfo | $pagingInfo = null |
||
) |
- See also
- PersistenceMapper::getOIDs()
Implements PersistenceMapper.
Definition at line 304 of file AbstractMapper.php.
◆ loadObjects()
loadObjects | ( | $type, | |
$buildDepth = BuildDepth::SINGLE , |
|||
$criteria = null , |
|||
$orderby = null , |
|||
PagingInfo | $pagingInfo = null |
||
) |
- See also
- PersistenceMapper::loadObjects()
Implements PersistenceMapper.
Definition at line 325 of file AbstractMapper.php.
◆ loadRelation()
loadRelation | ( | array | $objects, |
$role, | |||
$buildDepth = BuildDepth::SINGLE , |
|||
$criteria = null , |
|||
$orderby = null , |
|||
PagingInfo | $pagingInfo = null |
||
) |
Implements PersistenceMapper.
Definition at line 351 of file AbstractMapper.php.
◆ logAction()
|
protected |
Log the state of the given object.
- Parameters
-
$obj PersistentObject instance
Definition at line 381 of file AbstractMapper.php.
◆ checkAuthorization()
|
protected |
Check authorization on a resource (type/instance/instance property) and a given action.
- Parameters
-
$resource Resource to authorize $action Action to authorize
- Returns
- Boolean depending on success of authorization
Definition at line 393 of file AbstractMapper.php.
◆ authorizationFailedError()
|
protected |
Handle an authorization error.
- Parameters
-
$resource $action
- Exceptions
-
AuthorizationException
Definition at line 403 of file AbstractMapper.php.
◆ loadImpl()
|
abstractprotected |
- See also
- PersistenceFacade::load()
- Note
- Precondition: Object rights have been checked already
Reimplemented in AbstractRDBMapper.
◆ createImpl()
|
abstractprotected |
- See also
- PersistenceFacade::create()
- Note
- Precondition: Object rights have been checked already
Reimplemented in AbstractRDBMapper.
◆ saveImpl()
|
abstractprotected |
- See also
- PersistenceMapper::save()
- Note
- Precondition: Object rights have been checked already
Reimplemented in AbstractRDBMapper.
◆ deleteImpl()
|
abstractprotected |
- See also
- PersistenceMapper::delete()
- Note
- Precondition: Object rights have been checked already
Reimplemented in AbstractRDBMapper.
◆ getOIDsImpl()
|
abstractprotected |
- See also
- PersistenceMapper::getOIDs()
Reimplemented in AbstractRDBMapper.
◆ loadObjectsImpl()
|
abstractprotected |
- See also
- PersistenceMapper::loadObjects()
Reimplemented in AbstractRDBMapper.
◆ loadRelationImpl()
|
abstractprotected |
Reimplemented in AbstractRDBMapper.
Member Data Documentation
◆ $persistenceFacade
|
protected |
Definition at line 50 of file AbstractMapper.php.
◆ $permissionManager
|
protected |
Definition at line 51 of file AbstractMapper.php.
◆ $concurrencyManager
|
protected |
Definition at line 52 of file AbstractMapper.php.
◆ $eventManager
|
protected |
Definition at line 53 of file AbstractMapper.php.