Detailed Description
Default implementation of Transaction.
Definition at line 29 of file DefaultTransaction.php.
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()
|
protected |
Register a loaded object.
The returned object is the registered instance.
- Parameters
-
$object PersistentObject instance
- Returns
- PersistentObject instance
Definition at line 204 of file DefaultTransaction.php.
◆ registerNew()
|
protected |
Register a newly created object.
The returned object is the registered instance.
- Parameters
-
$object PersistentObject instance
Definition at line 246 of file DefaultTransaction.php.
◆ registerDirty()
|
protected |
Register a dirty object.
The returned object is the registered instance.
- Parameters
-
$object PersistentObject instance
Definition at line 260 of file DefaultTransaction.php.
◆ registerDeleted()
|
protected |
Register a deleted object.
The returned object is the registered instance.
- Parameters
-
$object PersistentObject instance
Definition at line 277 of file DefaultTransaction.php.
◆ commitImpl()
|
protected |
Commit the transaction.
- Parameters
-
$collect
- Returns
- Array of statements
Definition at line 301 of file DefaultTransaction.php.
◆ clear()
|
protected |
Clear all internal.
Definition at line 385 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 413 of file DefaultTransaction.php.
◆ processUpdates()
|
protected |
Process the dirty objects queue.
- Returns
- Array of oid strings of updated objects
Definition at line 459 of file DefaultTransaction.php.
◆ 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
-
$event StateChangeEvent instance
Definition at line 501 of file DefaultTransaction.php.
◆ dump()
|
protected |
Dump the registry content into a string.
- Returns
- String
Definition at line 535 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.