Detailed Description

Default implementation of Transaction.

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

Definition at line 29 of file DefaultTransaction.php.

+ Inheritance diagram for DefaultTransaction:

Public Member Functions

 __construct (PersistenceFacade $persistenceFacade, EventManager $eventManager)
 
 __destruct ()
 
 begin ()
 
 commit ()
 
 rollback ()
 
 isActive ()
 
 attach (PersistentObject $object)
 
 detach (ObjectId $oid)
 
 getLoaded (ObjectId $oid)
 
 getObjects ()
 
 stateChanged (StateChangeEvent $event)
 

Protected Member Functions

 registerLoaded (PersistentObject $object)
 
 registerNew (PersistentObject $object)
 
 registerDirty (PersistentObject $object)
 
 registerDeleted (PersistentObject $object)
 
 clear ()
 
 processInserts ()
 
 processUpdates ()
 
 processDeletes ()
 
 dump ()
 

Protected Attributes

 $newObjects = []
 
 $dirtyObjects = []
 
 $deletedObjects = []
 
 $detachedObjects = []
 
 $loadedObjects = []
 

Constructor & Destructor Documentation

__construct ( PersistenceFacade  $persistenceFacade,
EventManager  $eventManager 
)

Constructor.

Parameters
$persistenceFacade
$eventManager

Definition at line 58 of file DefaultTransaction.php.

__destruct ( )

Destructor.

Definition at line 75 of file DefaultTransaction.php.

Member Function Documentation

begin ( )
See also
Transaction::begin()

Implements Transaction.

Definition at line 82 of file DefaultTransaction.php.

commit ( )
See also
Transaction::commit()

Implements Transaction.

Definition at line 92 of file DefaultTransaction.php.

rollback ( )
See also
Transaction::rollback()

Implements Transaction.

Definition at line 167 of file DefaultTransaction.php.

isActive ( )
See also
Transaction::isActive()

Implements Transaction.

Definition at line 182 of file DefaultTransaction.php.

attach ( PersistentObject  $object)
See also
Transaction::attach()

Implements Transaction.

Definition at line 189 of file DefaultTransaction.php.

detach ( ObjectId  $oid)
See also
Transaction::detach()

Implements Transaction.

Definition at line 213 of file DefaultTransaction.php.

getLoaded ( ObjectId  $oid)
See also
Transaction::getLoaded()

Implements Transaction.

Definition at line 234 of file DefaultTransaction.php.

getObjects ( )
See also
Transaction::getObjects()

Implements Transaction.

Definition at line 249 of file DefaultTransaction.php.

registerLoaded ( PersistentObject  $object)
protected

Register a loaded object.

The returned object is the registered instance.

Parameters
$objectPersistentObject instance
Returns
PersistentObject instance

Definition at line 258 of file DefaultTransaction.php.

registerNew ( PersistentObject  $object)
protected

Register a newly created object.

The returned object is the registered instance.

Parameters
$objectPersistentObject instance

Definition at line 300 of file DefaultTransaction.php.

registerDirty ( PersistentObject  $object)
protected

Register a dirty object.

The returned object is the registered instance.

Parameters
$objectPersistentObject instance

Definition at line 314 of file DefaultTransaction.php.

registerDeleted ( PersistentObject  $object)
protected

Register a deleted object.

The returned object is the registered instance.

Parameters
$objectPersistentObject instance

Definition at line 331 of file DefaultTransaction.php.

clear ( )
protected

Clear all internal.

Definition at line 352 of file DefaultTransaction.php.

processInserts ( )
protected

Process the new objects queue.

Returns
Map of oid changes (key: oid string before commit, value: oid string after commit)

Definition at line 380 of file DefaultTransaction.php.

processUpdates ( )
protected

Process the dirty objects queue.

Definition at line 425 of file DefaultTransaction.php.

processDeletes ( )
protected

Process the deleted objects queue.

Definition at line 442 of file DefaultTransaction.php.

stateChanged ( StateChangeEvent  $event)

Listen to StateChangeEvents.

Parameters
$eventStateChangeEvent instance

Definition at line 460 of file DefaultTransaction.php.

dump ( )
protected

Dump the registry content into a string.

Returns
String

Definition at line 493 of file DefaultTransaction.php.

Member Data Documentation

$newObjects = []
protected

Definition at line 43 of file DefaultTransaction.php.

$dirtyObjects = []
protected

Definition at line 44 of file DefaultTransaction.php.

$deletedObjects = []
protected

Definition at line 45 of file DefaultTransaction.php.

$detachedObjects = []
protected

Definition at line 46 of file DefaultTransaction.php.

$loadedObjects = []
protected

Contains all loaded objects no matter which state they have.

Definition at line 51 of file DefaultTransaction.php.