RemoteCapablePersistenceFacade Class Reference

Detailed Description

RemoteCapablePersistenceFacade delegates local persistence operations to the default PersistenceFacadeImpl and remote operations to a remote server.

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

Definition at line 33 of file RemoteCapablePersistenceFacade.php.

+ Inheritance diagram for RemoteCapablePersistenceFacade:

Public Member Functions

 __construct (EventManager $eventManager, OutputStrategy $logStrategy, Session $session)
 
 setResolveProxies ($isResolvingProxies)
 
 isResolvingProxies ()
 
 setTranslatingValues ($isTranslatingValues)
 
 isTranslatingValues ()
 
 load (ObjectId $oid, $buildDepth=BuildDepth::SINGLE)
 
 create ($type, $buildDepth=BuildDepth::SINGLE)
 
 getOIDs ($type, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadObjects ($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
- Public Member Functions inherited from DefaultPersistenceFacade
 __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)
 

Public Attributes

const PROXY_OBJECTS_SESSION_VARNAME = 'RemoteCapablePersistenceFacadeImpl.proxyObjects'
 
const REMOTE_OBJECTS_SESSION_VARNAME = 'RemoteCapablePersistenceFacadeImpl.remoteObjects'
 

Protected Member Functions

 getProxyObject (ObjectId $umi, $buildDepth)
 
 loadRemoteObject (ObjectId $umi, $buildDepth)
 
 registerProxyObject (ObjectID $umi, PersistentObject $obj, $buildDepth)
 
 registerRemoteObject (ObjectId $umi, PersistentObject $obj, $buildDepth)
 
 registerObject (ObjectId $umi, PersistentObject $obj, $buildDepth, $varName)
 
 getRegisteredProxyObject (ObjectId $umi, $buildDepth)
 
 getRegisteredRemoteObject (ObjectId $umi, $buildDepth)
 
 getRegisteredObject (ObjectId $umi, $buildDepth, $varName)
 
 makeUmis ($oids, $umiPrefix)
 
- Protected Member Functions inherited from DefaultPersistenceFacade
 calculateSimpleType ($type)
 
 getCacheKey ($typeOrTypes, $buildDepth, $criteriaArray=null, $orderArray=null, PagingInfo $pagingInfo=null)
 

Constructor & Destructor Documentation

__construct ( EventManager  $eventManager,
OutputStrategy  $logStrategy,
Session  $session 
)

Constructor.

Parameters
$eventManager
$logStrategy
$session

Definition at line 53 of file RemoteCapablePersistenceFacade.php.

Member Function Documentation

setResolveProxies (   $isResolvingProxies)

Tell the PersistenceFacade implementation to resolve proxies or not.

Parameters
$isResolvingProxiesBoolean whether proxies should be resolved or not

Definition at line 78 of file RemoteCapablePersistenceFacade.php.

isResolvingProxies ( )

Check if the PersistenceFacade implementation is resolving proxies or not.

Returns
Boolean whether proxies are resolved or not

Definition at line 86 of file RemoteCapablePersistenceFacade.php.

setTranslatingValues (   $isTranslatingValues)

Tell the PersistenceFacade implementation to translate remote values or not.

Parameters
$isTranslatingValuesBoolean whether values should be translated or not

Definition at line 94 of file RemoteCapablePersistenceFacade.php.

isTranslatingValues ( )

Check if the PersistenceFacade implementation is translating remote values or not.

Returns
Boolean whether values are tanslated or not

Definition at line 102 of file RemoteCapablePersistenceFacade.php.

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

Implements PersistenceFacade.

Definition at line 109 of file RemoteCapablePersistenceFacade.php.

create (   $type,
  $buildDepth = BuildDepth::SINGLE 
)
getOIDs (   $type,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
loadObjects (   $type,
  $buildDepth = BuildDepth::SINGLE,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
getProxyObject ( ObjectId  $umi,
  $buildDepth 
)
protected

Get the proxy object for a remote object.

This method makes sure that a proxy for the given remote object exists. If it does not exist, it will be created.

Parameters
$umiThe universal model id (oid with server prefix)
$buildDepthbuildDepth One of the BUILDDEPTH constants or a number describing the number of generations to build (except BuildDepth::REQUIRED)
Returns
The proxy object.

Definition at line 172 of file RemoteCapablePersistenceFacade.php.

loadRemoteObject ( ObjectId  $umi,
  $buildDepth 
)
protected

Load the real subject of a proxy from the remote instance.

Parameters
$umiThe universal model id (oid with server prefix)
$buildDepthbuildDepth One of the BUILDDEPTH constants or a number describing the number of generations to build (except BuildDepth::REQUIRED)

Definition at line 214 of file RemoteCapablePersistenceFacade.php.

registerProxyObject ( ObjectID  $umi,
PersistentObject  $obj,
  $buildDepth 
)
protected

Save a proxy object in the session.

Parameters
$umiThe universal model id (oid with server prefix)
$objThe proxy object.
$buildDepthThe depth the object was loaded.

Definition at line 297 of file RemoteCapablePersistenceFacade.php.

registerRemoteObject ( ObjectId  $umi,
PersistentObject  $obj,
  $buildDepth 
)
protected

Save a remote object in the session.

Parameters
$umiThe universal model id (oid with server prefix)
$objThe remote object.
$buildDepthThe depth the object was loaded.

Definition at line 312 of file RemoteCapablePersistenceFacade.php.

registerObject ( ObjectId  $umi,
PersistentObject  $obj,
  $buildDepth,
  $varName 
)
protected

Save a object in the given session variable.

Parameters
$umiThe universal model id (oid with server prefix)
$objThe object to register.
$buildDepthThe depth the object was loaded.
$varNameThe session variable name.

Definition at line 326 of file RemoteCapablePersistenceFacade.php.

getRegisteredProxyObject ( ObjectId  $umi,
  $buildDepth 
)
protected

Get a proxy object from the session.

Parameters
$umiThe universal model id (oid with server prefix)
$buildDepthThe requested build depth.
Returns
The proxy object or null if not found.

Definition at line 346 of file RemoteCapablePersistenceFacade.php.

getRegisteredRemoteObject ( ObjectId  $umi,
  $buildDepth 
)
protected

Get a remote object from the session.

Parameters
$umiThe universal model id (oid with server prefix)
$buildDepthThe requested build depth.
Returns
The remote object or null if not found.

Definition at line 357 of file RemoteCapablePersistenceFacade.php.

getRegisteredObject ( ObjectId  $umi,
  $buildDepth,
  $varName 
)
protected

Get a object from the given session variable.

Parameters
$umiThe universal model id (oid with server prefix)
$buildDepthThe requested build depth.
$varNameThe session variable name
Returns
The object or null if not found.

Definition at line 369 of file RemoteCapablePersistenceFacade.php.

makeUmis (   $oids,
  $umiPrefix 
)
protected

Replace all object ids in an array with the umis according to the given umiPrefix.

Parameters
$oidsThe array of oids
$umiPrefixThe umi prefix
Returns
The array of umis

Definition at line 397 of file RemoteCapablePersistenceFacade.php.

Member Data Documentation

const PROXY_OBJECTS_SESSION_VARNAME = 'RemoteCapablePersistenceFacadeImpl.proxyObjects'

Definition at line 36 of file RemoteCapablePersistenceFacade.php.

const REMOTE_OBJECTS_SESSION_VARNAME = 'RemoteCapablePersistenceFacadeImpl.remoteObjects'

Definition at line 37 of file RemoteCapablePersistenceFacade.php.