DefaultPersistenceFacade Class Reference

Detailed Description

Default PersistenceFacade implementation.

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

Definition at line 35 of file DefaultPersistenceFacade.php.

+ Inheritance diagram for DefaultPersistenceFacade:

Public Member Functions

 __construct (EventManager $eventManager, OutputStrategy $logStrategy)
 
 __destruct ()
 
 setMappers ($mappers)
 
 getKnownTypes ()
 
 isKnownType ($type)
 
 getFullyQualifiedType ($type)
 
 getSimpleType ($type)
 
 load (ObjectId $oid, $buildDepth=BuildDepth::SINGLE)
 
 create ($type, $buildDepth=BuildDepth::SINGLE)
 
 getLastCreatedOID ($type)
 
 getOIDs ($type, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 getFirstOID ($type, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadObjects ($typeOrTypes, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadFirstObject ($typeOrTypes, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 getTransaction ()
 
 getMapper ($type)
 
 setMapper ($type, PersistenceMapper $mapper)
 
 stateChanged (StateChangeEvent $event)
 

Protected Member Functions

 calculateSimpleType ($type)
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( EventManager  $eventManager,
OutputStrategy  $logStrategy 
)

Constructor.

Parameters
$eventManager
$logStrategyOutputStrategy used for logging persistence actions.

Definition at line 49 of file DefaultPersistenceFacade.php.

◆ __destruct()

__destruct ( )

Destructor.

Definition at line 61 of file DefaultPersistenceFacade.php.

Member Function Documentation

◆ setMappers()

setMappers (   $mappers)

Set the PersistentMapper instances.

Parameters
$mappersAssociative array with the fully qualified mapped class names as keys and the mapper instances as values

Definition at line 71 of file DefaultPersistenceFacade.php.

◆ getKnownTypes()

getKnownTypes ( )

◆ isKnownType()

isKnownType (   $type)

◆ getFullyQualifiedType()

getFullyQualifiedType (   $type)

◆ getSimpleType()

getSimpleType (   $type)

◆ load()

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

Implements PersistenceFacade.

Reimplemented in RemoteCapablePersistenceFacade.

Definition at line 133 of file DefaultPersistenceFacade.php.

◆ create()

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

Implements PersistenceFacade.

Reimplemented in RemoteCapablePersistenceFacade.

Definition at line 152 of file DefaultPersistenceFacade.php.

◆ getLastCreatedOID()

getLastCreatedOID (   $type)

◆ getOIDs()

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

Implements PersistenceFacade.

Reimplemented in RemoteCapablePersistenceFacade.

Definition at line 180 of file DefaultPersistenceFacade.php.

◆ getFirstOID()

getFirstOID (   $type,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)

◆ loadObjects()

loadObjects (   $typeOrTypes,
  $buildDepth = BuildDepth::SINGLE,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)

◆ loadFirstObject()

loadFirstObject (   $typeOrTypes,
  $buildDepth = BuildDepth::SINGLE,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)

◆ getTransaction()

getTransaction ( )

◆ getMapper()

getMapper (   $type)
See also
PersistenceFacade::getMapper()

Implements PersistenceFacade.

Definition at line 253 of file DefaultPersistenceFacade.php.

◆ setMapper()

setMapper (   $type,
PersistenceMapper  $mapper 
)
See also
PersistenceFacade::setMapper()

Implements PersistenceFacade.

Definition at line 266 of file DefaultPersistenceFacade.php.

◆ stateChanged()

stateChanged ( StateChangeEvent  $event)

Listen to StateChangeEvents.

Parameters
$eventStateChangeEvent instance

Definition at line 299 of file DefaultPersistenceFacade.php.

◆ calculateSimpleType()

calculateSimpleType (   $type)
protected

Calculate the simple type name for a given fully qualified type name.

Parameters
$typeType name with namespace
Returns
Simple type name (without namespace)

Definition at line 318 of file DefaultPersistenceFacade.php.