Event
class Event (View source)
Base class for generic events
Properties
protected DateTime | $timestamp | When was this event? |
|
protected int | $uid | We introduce an auto_increment column to be able to sort events at the same timestamp |
|
protected string | $eventType | What was this event about? Is a required string constant. |
|
protected string | $accountIdentifier | The identifier of the account that triggered this event. Optional. |
|
protected array | $data | Payload of the event. |
|
protected Event | $parentEvent | The parent event, if exists. E.g. if a "move node" operation triggered a bunch of other events, or a "publish" |
|
protected Event> | $childEvents | Child events, of this event |
Methods
Create a new event
Return the type of this event
Return the timestamp of this event
Return the payload of this event
Return the identifier of the account (if any) which triggered this event
Return the parent event (if any)
Return the child events (if any)
Add a new child event. Is called from the child event's constructor.
Details
__construct(string $eventType, array $data, string $user = null, Event $parentEvent = null)
Create a new event
string
getEventType()
Return the type of this event
DateTime
getTimestamp()
Return the timestamp of this event
array
getData()
Return the payload of this event
string
getAccountIdentifier()
Return the identifier of the account (if any) which triggered this event
Event
getParentEvent()
Return the parent event (if any)
array
getChildEvents()
Return the child events (if any)
void
addChildEvent(Event $childEvent)
Add a new child event. Is called from the child event's constructor.