Menu

## EventContextData
in package

EventContextData.php : 14

EventContextData to provide a basic structure for managing contextual data of an event.

This class must be immutable and returns always a new instance of itself for any change.

##### Tags

immutable

### Table of Contents

$argumentConfig : array<string|int, mixed>|null
$data : array<string|int, mixed>
checkConfiguration() : mixed
  Checks a field configuration given in self::$argumentConfig.
create() : EventContextData
  Creates a new instance of a data container.
get() : mixed
  Returns the value of a field.
has() : bool
  Returns true if container has a certain field.
set() : EventContextData
  Sets a field to a new value and returns a new data container.
setFields() : EventContextData
  Sets multiple fields at once.
__construct() : mixed
  protected constructor.
getFormattedListOfFields() : string
  Returns a comma separated string with all allowed fields, for debugging reasons.
getListOfFields() : array<string|int, mixed>
  Returns a list of fields in this context.
throwException() : mixed
  internal use only - throws an ArgumentException a field is given that's not valid.

### Properties

#### $argumentConfig

EventContextData.php : 16
`protected static array<string|int, mixed>|null $argumentConfig = null`

#### $data

EventContextData.php : 23
`private array<string|int, mixed> $data`

### Methods

#### checkConfiguration()

EventContextData.php : 46

Checks a field configuration given in self::$argumentConfig.

`public static checkConfiguration(array<string|int, mixed> $data) : mixed`

##### Parameters

$data : array<string|int, mixed>

##### Tags

throws
  ArgumentException

##### Return values

mixed —

#### create()

EventContextData.php : 32

Creates a new instance of a data container.

`public static create(array<string|int, mixed> $data) : EventContextData`

Sub types can change this method to force certain parameters.

##### Parameters

$data : array<string|int, mixed>

##### Return values

EventContextData —

#### get()

EventContextData.php : 105

Returns the value of a field.

`public get(string $field) : mixed`

##### Parameters

$field : string

##### Return values

mixed —

#### has()

EventContextData.php : 95

Returns true if container has a certain field.

`public has(string $field) : bool`

##### Parameters

$field : string

##### Return values

bool —

#### set()

EventContextData.php : 119

Sets a field to a new value and returns a new data container.

`public set(string $field, mixed $value) : EventContextData`

##### Parameters

$field : string
$value : mixed

##### Return values

EventContextData —

#### setFields()

EventContextData.php : 135

Sets multiple fields at once.

`public setFields(array<string|int, mixed> $data) : EventContextData`

##### Parameters

$data : array<string|int, mixed>

  array of $field=>$value pairs

##### Return values

EventContextData —

#### __construct()

EventContextData.php : 23

protected constructor.

`protected __construct(array<string|int, mixed> $data) : mixed`

.

##### Parameters

$data : array<string|int, mixed>

##### Tags

see
  self::create

##### Return values

mixed —

#### getFormattedListOfFields()

EventContextData.php : 163

Returns a comma separated string with all allowed fields, for debugging reasons.

`private getFormattedListOfFields() : string`

##### Return values

string —

#### getListOfFields()

EventContextData.php : 154

Returns a list of fields in this context.

`private getListOfFields() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### throwException()

EventContextData.php : 177

internal use only - throws an ArgumentException a field is given that's not valid.

`private throwException( $field) : mixed`

##### Parameters

$field :

##### Tags

throws
  ArgumentException

##### Return values

mixed —

## Search results