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

__construct ( PersistenceFacade  $persistenceFacade,
EventManager  $eventManager 
)

Constructor.

Parameters
$persistenceFacade
$eventManager

Definition at line 58 of file DefaultTransaction.php.

◆ __destruct()

__destruct ( )

Destructor.

Definition at line 75 of file DefaultTransaction.php.

Member Function Documentation

◆ begin()

begin ( )
See also
Transaction::begin()

Implements Transaction.

Definition at line 82 of file DefaultTransaction.php.

◆ commit()

commit ( )
See also
Transaction::commit()

Implements Transaction.

Definition at line 92 of file DefaultTransaction.php.

◆ commitCollect()

commitCollect ( )
See also
Transaction::commitCollect()

Implements Transaction.

Definition at line 99 of file DefaultTransaction.php.

◆ rollback()

rollback ( )
See also
Transaction::rollback()

Implements Transaction.

Definition at line 106 of file DefaultTransaction.php.

◆ isActive()

isActive ( )
See also
Transaction::isActive()

Implements Transaction.

Definition at line 121 of file DefaultTransaction.php.

◆ attach()

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

Implements Transaction.

Definition at line 128 of file DefaultTransaction.php.

◆ detach()

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

Implements Transaction.

Definition at line 154 of file DefaultTransaction.php.

◆ getLoaded()

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

Implements Transaction.

Definition at line 180 of file DefaultTransaction.php.

◆ getObjects()

getObjects ( )
See also
Transaction::getObjects()

Implements Transaction.

Definition at line 195 of file DefaultTransaction.php.

◆ registerLoaded()

registerLoaded ( PersistentObject  $object)
protected

Register a loaded object.

The returned object is the registered instance.

Parameters
$objectPersistentObject instance
Returns
PersistentObject instance

Definition at line 204 of file DefaultTransaction.php.

◆ registerNew()

registerNew ( PersistentObject  $object)
protected

Register a newly created object.

The returned object is the registered instance.

Parameters
$objectPersistentObject instance

Definition at line 246 of file DefaultTransaction.php.

◆ registerDirty()

registerDirty ( PersistentObject  $object)
protected

Register a dirty object.

The returned object is the registered instance.

Parameters
$objectPersistentObject instance

Definition at line 260 of file DefaultTransaction.php.

◆ registerDeleted()

registerDeleted ( PersistentObject  $object)
protected

Register a deleted object.

The returned object is the registered instance.

Parameters
$objectPersistentObject instance

Definition at line 277 of file DefaultTransaction.php.

◆ commitImpl()

commitImpl (   $collect)
protected

Commit the transaction.

Parameters
$collect
Returns
Array of statements

Definition at line 301 of file DefaultTransaction.php.

◆ clear()

clear ( )
protected

Clear all internal.

Definition at line 385 of file DefaultTransaction.php.

◆ processInserts()

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 413 of file DefaultTransaction.php.

◆ processUpdates()

processUpdates ( )
protected

Process the dirty objects queue.

Returns
Array of oid strings of updated objects

Definition at line 459 of file DefaultTransaction.php.

◆ processDeletes()

processDeletes ( )
protected

Process the deleted objects queue.

Returns
Array of oid strings of deleted objects

Definition at line 480 of file DefaultTransaction.php.

◆ stateChanged()

stateChanged ( StateChangeEvent  $event)

Listen to StateChangeEvents.

Parameters
$eventStateChangeEvent instance

Definition at line 501 of file DefaultTransaction.php.

◆ dump()

dump ( )
protected

Dump the registry content into a string.

Returns
String

Definition at line 535 of file DefaultTransaction.php.

Member Data Documentation

◆ $newObjects

$newObjects = []
protected

Definition at line 43 of file DefaultTransaction.php.

◆ $dirtyObjects

$dirtyObjects = []
protected

Definition at line 44 of file DefaultTransaction.php.

◆ $deletedObjects

$deletedObjects = []
protected

Definition at line 45 of file DefaultTransaction.php.

◆ $detachedObjects

$detachedObjects = []
protected

Definition at line 46 of file DefaultTransaction.php.

◆ $loadedObjects

$loadedObjects = []
protected

Contains all loaded objects no matter which state they have.

Definition at line 51 of file DefaultTransaction.php.