TransactionEvent Class Reference

Detailed Description

TransactionEvent instances are fired at different phases of a transaction.

Note that depending on the phase, some of the properties may be null, because they are not initialized yet (e.g. controller).

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

Definition at line 23 of file TransactionEvent.php.

+ Inheritance diagram for TransactionEvent:

Public Member Functions

 __construct ($phase, array $changedOids=[])
 
 getPhase ()
 
 getChangedOids ()
 
- Public Member Functions inherited from Event
 stopPropagation ()
 
 isStopped ()
 

Public Attributes

const NAME = __CLASS__
 
const BEFORE_COMMIT = 'BEFORE_COMMIT'
 
const AFTER_COMMIT = 'AFTER_COMMIT'
 
const AFTER_ROLLBACK = 'AFTER_ROLLBACK'
 

Constructor & Destructor Documentation

__construct (   $phase,
array  $changedOids = [] 
)

Constructor.

Parameters
$phaseThe phase at which the event occurred.
$oidsAssociative array mapping old to new object ids

Definition at line 50 of file TransactionEvent.php.

Member Function Documentation

getPhase ( )

Get the phase at which the event occurred.

Returns
String

Definition at line 59 of file TransactionEvent.php.

getChangedOids ( )

Get the map of changed object ids.

NOTE: This property is available after commit only

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

Definition at line 68 of file TransactionEvent.php.

Member Data Documentation

const NAME = __CLASS__

Definition at line 25 of file TransactionEvent.php.

const BEFORE_COMMIT = 'BEFORE_COMMIT'

A BEFORE_COMMIT event occurs before the transaction is committed.

Definition at line 30 of file TransactionEvent.php.

const AFTER_COMMIT = 'AFTER_COMMIT'

An AFTER_COMMIT event occurs after the transaction is committed.

Definition at line 35 of file TransactionEvent.php.

const AFTER_ROLLBACK = 'AFTER_ROLLBACK'

An AFTER_ROLLBACK event occurs after the transaction is rolled back.

Definition at line 40 of file TransactionEvent.php.