EventContext
in package
Class EventContext.
Tags
Table of Contents
- $data : EventContextData
- $event : string
- $matchingPattern : string
- __construct() : mixed
- EventContext constructor.
- getData() : EventContextData
- Returns the immutable data container.
- getDataField() : mixed
- Returns a data field.
- getEvent() : string
- Returns the event of this context.
- getMatchingPattern() : string
- Returns the matching pattern of this context.
- hasDataChanged() : bool
- Checks if given original data is the same as currently held within this context.
- hasDataType() : bool
- Checks if the data in this event context has a certain subtype.
- setDataField() : mixed
- Sets a data field.
- setDataFields() : mixed
- Sets multiple data fields at once.
Properties
$data
private
EventContextData
$data
$event
private
string
$event
$matchingPattern
private
string
$matchingPattern
Methods
__construct()
EventContext constructor.
public
__construct(string $event, string $matchingPattern, EventContextData $data) : mixed
Parameters
- $event : string
-
The published event
- $matchingPattern : string
-
The matching pattern
- $data : EventContextData
Return values
mixed —getData()
Returns the immutable data container.
public
getData() : EventContextData
Return values
EventContextData —getDataField()
Returns a data field.
public
getDataField( $field) : mixed
Parameters
Return values
mixed —getEvent()
Returns the event of this context.
public
getEvent() : string
Return values
string —getMatchingPattern()
Returns the matching pattern of this context.
public
getMatchingPattern() : string
Return values
string —hasDataChanged()
Checks if given original data is the same as currently held within this context.
public
hasDataChanged(EventContextData $originalData) : bool
Parameters
- $originalData : EventContextData
Return values
bool —hasDataType()
Checks if the data in this event context has a certain subtype.
public
hasDataType(string $type) : bool
Parameters
- $type : string
-
FQCN to be checked.
Return values
bool —setDataField()
Sets a data field.
public
setDataField( $field, $value) : mixed
Parameters
Return values
mixed —setDataFields()
Sets multiple data fields at once.
public
setDataFields( $data) : mixed