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 $insertedOids=[], array $updatedOids=[], array $deletedOids=[])
 
 getPhase ()
 
 getInsertedOids ()
 
 getUpdatedOids ()
 
 getDeletedOids ()
 
- 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()

__construct (   $phase,
array  $insertedOids = [],
array  $updatedOids = [],
array  $deletedOids = [] 
)

Constructor.

Parameters
$phaseThe phase at which the event occurred.
$insertedOidsAssociative array mapping old to new object id strings
$updatedOidsArray of object id strings of updated objects
$deletedOidsArray of object id strings of deleted objects

Definition at line 54 of file TransactionEvent.php.

Member Function Documentation

◆ getPhase()

getPhase ( )

Get the phase at which the event occurred.

Returns
String

Definition at line 65 of file TransactionEvent.php.

◆ getInsertedOids()

getInsertedOids ( )

Get the map of oids of inserted objects.

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 74 of file TransactionEvent.php.

◆ getUpdatedOids()

getUpdatedOids ( )

Get the list of oids of updated objects.

NOTE: This property is available after commit only

Returns
Array of oid strings

Definition at line 83 of file TransactionEvent.php.

◆ getDeletedOids()

getDeletedOids ( )

Get the list of oids of deleted objects.

NOTE: This property is available after commit only

Returns
Array of oid strings

Definition at line 92 of file TransactionEvent.php.

Member Data Documentation

◆ NAME

const NAME = __CLASS__

Definition at line 25 of file TransactionEvent.php.

◆ BEFORE_COMMIT

const BEFORE_COMMIT = 'BEFORE_COMMIT'

A BEFORE_COMMIT event occurs before the transaction is committed.

Definition at line 30 of file TransactionEvent.php.

◆ AFTER_COMMIT

const AFTER_COMMIT = 'AFTER_COMMIT'

An AFTER_COMMIT event occurs after the transaction is committed.

Definition at line 35 of file TransactionEvent.php.

◆ AFTER_ROLLBACK

const AFTER_ROLLBACK = 'AFTER_ROLLBACK'

An AFTER_ROLLBACK event occurs after the transaction is rolled back.

Definition at line 40 of file TransactionEvent.php.