Detailed Description

PersistentObjectProxy is proxy for an PersistentObject instance.

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

Definition at line 24 of file PersistentObjectProxy.php.

+ Inheritance diagram for PersistentObjectProxy:

Public Member Functions

 __construct (ObjectId $oid)
 
 getRealSubject ()
 
 __call ($name, array $arguments)
 
 resolve ($buildDepth=BuildDepth::SINGLE)
 
 initialize (array $data)
 
 getType ()
 
 getMapper ()
 
 getOID ()
 
 setOID (ObjectId $oid)
 
 getState ()
 
 setState ($state)
 
 delete ()
 
 __clone ()
 
 copyValues (PersistentObject $object, $copyPkValues=true)
 
 mergeValues (PersistentObject $object)
 
 clearValues ()
 
 reset ()
 
 afterCreate ()
 
 beforeInsert ()
 
 afterInsert ()
 
 afterLoad ()
 
 beforeUpdate ()
 
 afterUpdate ()
 
 beforeDelete ()
 
 afterDelete ()
 
 getValue ($name)
 
 setValue ($name, $value, $forceSet=false, $trackChange=true)
 
 hasValue ($name)
 
 removeValue ($name)
 
 validateValues ()
 
 validateValue ($name, $value)
 
 getChangedValues ()
 
 getOriginalValue ($name)
 
 getIndispensableObjects ()
 
 getProperty ($name)
 
 setProperty ($name, $value)
 
 getPropertyNames ()
 
 getValueProperty ($name, $property)
 
 setValueProperty ($name, $property, $value)
 
 getValuePropertyNames ($name)
 
 getValueNames ($excludeTransient=false)
 
 getDisplayValue ()
 
 dump ()
 
 __toString ()
 

Static Public Member Functions

static fromObject ($object)
 

Protected Attributes

 $oid = null
 
 $realSubject = null
 

Additional Inherited Members

- Public Attributes inherited from PersistentObject
const STATE_CLEAN = 0
 
const STATE_DIRTY = 1
 
const STATE_NEW = 2
 
const STATE_DELETED = 3
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( ObjectId  $oid)

Constructor.

Parameters
$oidThe object id of the PersistentObject instance.

Definition at line 33 of file PersistentObjectProxy.php.

Member Function Documentation

◆ fromObject()

static fromObject (   $object)
static

Create a PersistenceProxy instance from a PersistentObject.

This is useful if you want to prevent automatic loading of the subject if it is already loaded. Returns the argument, if already an PersistentObjectProxy instance.

Parameters
$objectThe PersistentObject or PersistentObjectProxy
Returns
PersistentObjectProxy

Definition at line 44 of file PersistentObjectProxy.php.

◆ getRealSubject()

getRealSubject ( )

Get the PersistentObject instance.

Returns
PersistentObject

Definition at line 62 of file PersistentObjectProxy.php.

◆ __call()

__call (   $name,
array  $arguments 
)

Delegate method call to the instance.

Definition at line 72 of file PersistentObjectProxy.php.

◆ resolve()

resolve (   $buildDepth = BuildDepth::SINGLE)

Load the PersistentObject instance.

Use this method if the subject should be loaded with a depth greater than BuildDepth::SINGLE

Parameters
$buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to build (default: BuildDepth::SINGLE)

Definition at line 85 of file PersistentObjectProxy.php.

◆ initialize()

initialize ( array  $data)
See also
PersistentObject::initialize()

Definition at line 95 of file PersistentObjectProxy.php.

◆ getType()

getType ( )

Get the type of the PersistentObject.

Returns
String

Implements PersistentObject.

Definition at line 103 of file PersistentObjectProxy.php.

◆ getMapper()

getMapper ( )
See also
PersistentObject::getMapper()

Implements PersistentObject.

Definition at line 110 of file PersistentObjectProxy.php.

◆ getOID()

getOID ( )

Get the object id of the PersistentObject.

Returns
ObjectId

Implements PersistentObject.

Definition at line 118 of file PersistentObjectProxy.php.

◆ setOID()

setOID ( ObjectId  $oid)
See also
PersistentObject::setOID()

Implements PersistentObject.

Definition at line 125 of file PersistentObjectProxy.php.

◆ getState()

getState ( )
See also
PersistentObject::getState()

Implements PersistentObject.

Definition at line 132 of file PersistentObjectProxy.php.

◆ setState()

setState (   $state)
See also
PersistentObject::setState()

Implements PersistentObject.

Definition at line 139 of file PersistentObjectProxy.php.

◆ delete()

delete ( )
See also
PersistentObject::delete()

Implements PersistentObject.

Definition at line 146 of file PersistentObjectProxy.php.

◆ __clone()

__clone ( )
See also
PersistentObject::__clone()

Implements PersistentObject.

Definition at line 153 of file PersistentObjectProxy.php.

◆ copyValues()

copyValues ( PersistentObject  $object,
  $copyPkValues = true 
)
See also
PersistentObject::copyValues()

Implements PersistentObject.

Definition at line 160 of file PersistentObjectProxy.php.

◆ mergeValues()

mergeValues ( PersistentObject  $object)
See also
PersistentObject::mergeValues()

Implements PersistentObject.

Definition at line 167 of file PersistentObjectProxy.php.

◆ clearValues()

clearValues ( )
See also
PersistentObject::clearValues()

Implements PersistentObject.

Definition at line 174 of file PersistentObjectProxy.php.

◆ reset()

reset ( )
See also
PersistentObject::reset()

Implements PersistentObject.

Definition at line 181 of file PersistentObjectProxy.php.

◆ afterCreate()

afterCreate ( )
See also
PersistentObject::afterCreate()

Implements PersistentObject.

Definition at line 188 of file PersistentObjectProxy.php.

◆ beforeInsert()

beforeInsert ( )
See also
PersistentObject::beforeInsert()

Implements PersistentObject.

Definition at line 195 of file PersistentObjectProxy.php.

◆ afterInsert()

afterInsert ( )
See also
PersistentObject::afterInsert()

Implements PersistentObject.

Definition at line 202 of file PersistentObjectProxy.php.

◆ afterLoad()

afterLoad ( )
See also
PersistentObject::afterLoad()

Implements PersistentObject.

Definition at line 209 of file PersistentObjectProxy.php.

◆ beforeUpdate()

beforeUpdate ( )
See also
PersistentObject::beforeUpdate()

Implements PersistentObject.

Definition at line 216 of file PersistentObjectProxy.php.

◆ afterUpdate()

afterUpdate ( )
See also
PersistentObject::afterUpdate()

Implements PersistentObject.

Definition at line 223 of file PersistentObjectProxy.php.

◆ beforeDelete()

beforeDelete ( )
See also
PersistentObject::beforeDelete()

Implements PersistentObject.

Definition at line 230 of file PersistentObjectProxy.php.

◆ afterDelete()

afterDelete ( )
See also
PersistentObject::afterDelete()

Implements PersistentObject.

Definition at line 237 of file PersistentObjectProxy.php.

◆ getValue()

getValue (   $name)

Get the value of a named item.

Parameters
$nameThe name of the item to query.
Returns
The value of the item / null if it doesn't exits.

Implements PersistentObject.

Definition at line 246 of file PersistentObjectProxy.php.

◆ setValue()

setValue (   $name,
  $value,
  $forceSet = false,
  $trackChange = true 
)
See also
PersistentObject::setValue()

Implements PersistentObject.

Definition at line 262 of file PersistentObjectProxy.php.

◆ hasValue()

hasValue (   $name)
See also
PersistentObject::hasValue()

Implements PersistentObject.

Definition at line 269 of file PersistentObjectProxy.php.

◆ removeValue()

removeValue (   $name)
See also
PersistentObject::removeValue()

Implements PersistentObject.

Definition at line 276 of file PersistentObjectProxy.php.

◆ validateValues()

validateValues ( )
See also
PersistentObject::validateValues()

Implements PersistentObject.

Definition at line 283 of file PersistentObjectProxy.php.

◆ validateValue()

validateValue (   $name,
  $value 
)
See also
PersistentObject::validateValue()

Implements PersistentObject.

Definition at line 290 of file PersistentObjectProxy.php.

◆ getChangedValues()

getChangedValues ( )

◆ getOriginalValue()

getOriginalValue (   $name)

◆ getIndispensableObjects()

getIndispensableObjects ( )

◆ getProperty()

getProperty (   $name)
See also
PersistentObject::getProperty()

Implements PersistentObject.

Definition at line 318 of file PersistentObjectProxy.php.

◆ setProperty()

setProperty (   $name,
  $value 
)
See also
PersistentObject::setProperty()

Implements PersistentObject.

Definition at line 325 of file PersistentObjectProxy.php.

◆ getPropertyNames()

getPropertyNames ( )

◆ getValueProperty()

getValueProperty (   $name,
  $property 
)

◆ setValueProperty()

setValueProperty (   $name,
  $property,
  $value 
)

◆ getValuePropertyNames()

getValuePropertyNames (   $name)

◆ getValueNames()

getValueNames (   $excludeTransient = false)
See also
PersistentObject::getValueNames()

Implements PersistentObject.

Definition at line 360 of file PersistentObjectProxy.php.

◆ getDisplayValue()

getDisplayValue ( )
See also
PersistentObject::getDisplayValue()
Note
Subclasses will override this for special application requirements

Implements PersistentObject.

Definition at line 368 of file PersistentObjectProxy.php.

◆ dump()

dump ( )
See also
PersistentObject::dump()

Implements PersistentObject.

Definition at line 375 of file PersistentObjectProxy.php.

◆ __toString()

__toString ( )

Get a string representation of the instance.

Returns
String

Definition at line 383 of file PersistentObjectProxy.php.

Member Data Documentation

◆ $oid

$oid = null
protected

Definition at line 26 of file PersistentObjectProxy.php.

◆ $realSubject

$realSubject = null
protected

Definition at line 27 of file PersistentObjectProxy.php.