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 ()
 
 commitCollect ()
 
 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)
 
 commitImpl ($collect)
 
 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.

commitCollect ( )
See also
Transaction::commitCollect()

Implements Transaction.

Definition at line 99 of file DefaultTransaction.php.

rollback ( )
See also
Transaction::rollback()

Implements Transaction.

Definition at line 106 of file DefaultTransaction.php.

isActive ( )
See also
Transaction::isActive()

Implements Transaction.

Definition at line 121 of file DefaultTransaction.php.

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

Implements Transaction.

Definition at line 128 of file DefaultTransaction.php.

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

Implements Transaction.

Definition at line 152 of file DefaultTransaction.php.

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

Implements Transaction.

Definition at line 178 of file DefaultTransaction.php.

getObjects ( )
See also
Transaction::getObjects()

Implements Transaction.

Definition at line 193 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 202 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 244 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 258 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 275 of file DefaultTransaction.php.

commitImpl (   $collect)
protected

Commit the transaction.

Parameters
$collect
Returns
Array of statements

Definition at line 299 of file DefaultTransaction.php.

clear ( )
protected

Clear all internal.

Definition at line 383 of file DefaultTransaction.php.

processInserts ( )
protected

Process the new objects queue.

Returns
Map of oids of inserted objects (key: oid string before commit, value: oid string after commit)

Definition at line 411 of file DefaultTransaction.php.

processUpdates ( )
protected

Process the dirty objects queue.

Returns
Array of oid strings of updated objects

Definition at line 457 of file DefaultTransaction.php.

processDeletes ( )
protected

Process the deleted objects queue.

Returns
Array of oid strings of deleted objects

Definition at line 478 of file DefaultTransaction.php.

stateChanged ( StateChangeEvent  $event)

Listen to StateChangeEvents.

Parameters
$eventStateChangeEvent instance

Definition at line 499 of file DefaultTransaction.php.

dump ( )
protected

Dump the registry content into a string.

Returns
String

Definition at line 533 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.