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)
 
 getLastCreatedOID ($type)
 
 getFirstOID ($type, $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)
 

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
$eventManager
$logStrategy
$session

Definition at line 53 of file RemoteCapablePersistenceFacade.php.

Member Function Documentation

◆ setResolveProxies()

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()

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()

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()

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()

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

Reimplemented from DefaultPersistenceFacade.

Definition at line 109 of file RemoteCapablePersistenceFacade.php.

◆ create()

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

Reimplemented from DefaultPersistenceFacade.

Definition at line 130 of file RemoteCapablePersistenceFacade.php.

◆ getOIDs()

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

Reimplemented from DefaultPersistenceFacade.

Definition at line 138 of file RemoteCapablePersistenceFacade.php.

◆ loadObjects()

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

◆ getProxyObject()

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()

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()

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()

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()

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 324 of file RemoteCapablePersistenceFacade.php.

◆ getRegisteredProxyObject()

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 344 of file RemoteCapablePersistenceFacade.php.

◆ getRegisteredRemoteObject()

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 355 of file RemoteCapablePersistenceFacade.php.

◆ getRegisteredObject()

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 367 of file RemoteCapablePersistenceFacade.php.

◆ makeUmis()

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 395 of file RemoteCapablePersistenceFacade.php.

Member Data Documentation

◆ PROXY_OBJECTS_SESSION_VARNAME

const PROXY_OBJECTS_SESSION_VARNAME = 'RemoteCapablePersistenceFacadeImpl.proxyObjects'

Definition at line 36 of file RemoteCapablePersistenceFacade.php.

◆ REMOTE_OBJECTS_SESSION_VARNAME

const REMOTE_OBJECTS_SESSION_VARNAME = 'RemoteCapablePersistenceFacadeImpl.remoteObjects'

Definition at line 37 of file RemoteCapablePersistenceFacade.php.