Detailed Description

AbstractMapper provides a basic implementation for other mapper classes.

It handles authorization on entity level and calls the lifecycle callcacks of PersistentObject instances. Authorization on attribute level has to be implemented by subclasses.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 38 of file AbstractMapper.php.

+ Inheritance diagram for AbstractMapper:

Public Member Functions

 __construct (PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ConcurrencyManager $concurrencyManager, EventManager $eventManager, Message $message)
 
 setLogStrategy (OutputStrategy $logStrategy)
 
 hasRelation ($roleName)
 
 hasAttribute ($name)
 
 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 ()
 
 getTypeDisplayName (Message $message)
 
 getTypeDescription (Message $message)
 
 getPkNames ()
 
 getQuoteIdentifierSymbol ()
 
 quoteIdentifier ($identifier)
 
 quoteValue ($value)
 
 getRelations ($hierarchyType='all')
 
 getRelation ($roleName)
 
 getRelationsByType ($type)
 
 getAttributes (array $tags=array(), $matchMode='all')
 
 getAttribute ($name)
 
 getAttributeDisplayName ($name, Message $message)
 
 getAttributeDescription ($name, Message $message)
 
 getProperties ()
 
 isSortable ($roleName=null)
 
 getSortkey ($roleName=null)
 
 getDefaultOrder ($roleName=null)
 
 executeOperation (PersistenceOperation $operation)
 
 beginTransaction ()
 
 commitTransaction ()
 
 rollbackTransaction ()
 

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
 
 $_message = null
 

Constructor & Destructor Documentation

__construct ( PersistenceFacade  $persistenceFacade,
PermissionManager  $permissionManager,
ConcurrencyManager  $concurrencyManager,
EventManager  $eventManager,
Message  $message 
)

Constructor.

Parameters
$persistenceFacade
$permissionManager
$concurrencyManager
$eventManager
$message

Definition at line 61 of file AbstractMapper.php.

Member Function Documentation

setLogStrategy ( OutputStrategy  $logStrategy)

Set the OutputStrategy used for logging persistence actions.

Parameters
$logStrategy

Definition at line 80 of file AbstractMapper.php.

hasRelation (   $roleName)
See also
PersistenceMapper::hasRelation()

Implements PersistenceMapper.

Definition at line 87 of file AbstractMapper.php.

hasAttribute (   $name)
See also
PersistenceMapper::hasAttribute()

Implements PersistenceMapper.

Definition at line 104 of file AbstractMapper.php.

load ( ObjectId  $oid,
  $buildDepth = BuildDepth::SINGLE 
)
See also
PersistenceMapper::load()

Implements PersistenceMapper.

Definition at line 121 of file AbstractMapper.php.

create (   $type,
  $buildDepth = BuildDepth::SINGLE 
)
See also
PersistenceMapper::create()

Implements PersistenceMapper.

Definition at line 142 of file AbstractMapper.php.

save ( PersistentObject  $object)
See also
PersistenceMapper::save()

Implements PersistenceMapper.

Definition at line 158 of file AbstractMapper.php.

delete ( PersistentObject  $object)
See also
PersistenceMapper::delete()

Implements PersistenceMapper.

Definition at line 216 of file AbstractMapper.php.

getOIDs (   $type,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
See also
PersistenceMapper::getOIDs()

Implements PersistenceMapper.

Definition at line 249 of file AbstractMapper.php.

loadObjects (   $type,
  $buildDepth = BuildDepth::SINGLE,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
See also
PersistenceMapper::loadObjects()

Implements PersistenceMapper.

Definition at line 270 of file AbstractMapper.php.

loadRelation ( array  $objects,
  $role,
  $buildDepth = BuildDepth::SINGLE,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
See also
PersistenceMapper::loadRelation()

Implements PersistenceMapper.

Definition at line 296 of file AbstractMapper.php.

logAction ( PersistentObject  $obj)
protected

Log the state of the given object.

Parameters
$objPersistentObject instance

Definition at line 326 of file AbstractMapper.php.

checkAuthorization (   $resource,
  $action 
)
protected

Check authorization on a resource (type/instance/instance property) and a given action.

Parameters
$resourceResource to authorize
$actionAction to authorize
Returns
Boolean depending on success of authorization

Definition at line 338 of file AbstractMapper.php.

authorizationFailedError (   $resource,
  $action 
)
protected

Handle an authorization error.

Parameters
$resource
$action
Exceptions
AuthorizationException

Definition at line 348 of file AbstractMapper.php.

loadImpl ( ObjectId  $oid,
  $buildDepth = BuildDepth::SINGLE 
)
abstractprotected
See also
PersistenceFacade::load()
Note
Precondition: Object rights have been checked already
createImpl (   $type,
  $buildDepth = BuildDepth::SINGLE 
)
abstractprotected
See also
PersistenceFacade::create()
Note
Precondition: Object rights have been checked already
saveImpl ( PersistentObject  $object)
abstractprotected
See also
PersistenceMapper::save()
Note
Precondition: Object rights have been checked already
deleteImpl ( PersistentObject  $object)
abstractprotected
See also
PersistenceMapper::delete()
Note
Precondition: Object rights have been checked already
getOIDsImpl (   $type,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
abstractprotected
loadObjectsImpl (   $type,
  $buildDepth = BuildDepth::SINGLE,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
abstractprotected
loadRelationImpl ( array  $objects,
  $role,
  $buildDepth = BuildDepth::SINGLE,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
abstractprotected

Member Data Documentation

$_persistenceFacade = null
protected

Definition at line 47 of file AbstractMapper.php.

$_permissionManager = null
protected

Definition at line 48 of file AbstractMapper.php.

$_concurrencyManager = null
protected

Definition at line 49 of file AbstractMapper.php.

$_eventManager = null
protected

Definition at line 50 of file AbstractMapper.php.

$_message = null
protected

Definition at line 51 of file AbstractMapper.php.