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

__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.

◆ rollback()

rollback ( )
See also
Transaction::rollback()

Implements Transaction.

Definition at line 168 of file DefaultTransaction.php.

◆ isActive()

isActive ( )
See also
Transaction::isActive()

Implements Transaction.

Definition at line 183 of file DefaultTransaction.php.

◆ attach()

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

Implements Transaction.

Definition at line 190 of file DefaultTransaction.php.

◆ detach()

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

Implements Transaction.

Definition at line 214 of file DefaultTransaction.php.

◆ getLoaded()

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

Implements Transaction.

Definition at line 240 of file DefaultTransaction.php.

◆ getObjects()

getObjects ( )
See also
Transaction::getObjects()

Implements Transaction.

Definition at line 255 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 264 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 306 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 320 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 337 of file DefaultTransaction.php.

◆ clear()

clear ( )
protected

Clear all internal.

Definition at line 358 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 386 of file DefaultTransaction.php.

◆ processUpdates()

processUpdates ( )
protected

Process the dirty objects queue.

Returns
Array of oid strings of updated objects

Definition at line 432 of file DefaultTransaction.php.

◆ processDeletes()

processDeletes ( )
protected

Process the deleted objects queue.

Returns
Array of oid strings of deleted objects

Definition at line 453 of file DefaultTransaction.php.

◆ stateChanged()

stateChanged ( StateChangeEvent  $event)

Listen to StateChangeEvents.

Parameters
$eventStateChangeEvent instance

Definition at line 474 of file DefaultTransaction.php.

◆ dump()

dump ( )
protected

Dump the registry content into a string.

Returns
String

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