Menu

## EventContext
in package

EventContext.php : 10

Class EventContext.

##### Tags

immutable

### 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

EventContext.php : 21
`private EventContextData $data`

#### $event

EventContext.php : 19
`private string $event`

#### $matchingPattern

EventContext.php : 20
`private string $matchingPattern`

### Methods

#### __construct()

EventContext.php : 18

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()

EventContext.php : 57

Returns the immutable data container.

`public getData() : EventContextData`

##### Return values

EventContextData —

#### getDataField()

EventContext.php : 67

Returns a data field.

`public getDataField( $field) : mixed`

##### Parameters

$field :

##### Return values

mixed —

#### getEvent()

EventContext.php : 29

Returns the event of this context.

`public getEvent() : string`

##### Return values

string —

#### getMatchingPattern()

EventContext.php : 38

Returns the matching pattern of this context.

`public getMatchingPattern() : string`

##### Return values

string —

#### hasDataChanged()

EventContext.php : 96

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()

EventContext.php : 48

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()

EventContext.php : 77

Sets a data field.

`public setDataField( $field, $value) : mixed`

##### Parameters

$field :
$value :

##### Return values

mixed —

#### setDataFields()

EventContext.php : 86

Sets multiple data fields at once.

`public setDataFields( $data) : mixed`

##### Parameters

$data :

##### Return values

mixed —

## Search results