class Data extends ArrayObject (View source)

A State\Data object contains a "message" (the primary result) and a data array (the persistent state). The message is transient, and does not move into the persistent state unless explicitly copied there.

Properties

protected string $message

Methods

__construct(string $message = '', array $data = [])

No description

array
getData()

No description

string
getMessage()

No description

setMessage(string $message)

No description

$this
merge(Data $result)

Merge another result into this result. Data already existing in this result takes precedence over the data in the Result being merged.

$this
update(ArrayObject $update)

Update the current data with the data provided in the parameter.

array
mergeData(array $data)

Merge another result into this result. Data already existing in this result takes precedence over the data in the Result being merged.

bool
hasExecutionTime()

No description

null|float
getExecutionTime()

No description

null|float
accumulateExecutionTime(array|float $duration)

Accumulate execution time

string
accumulateMessage(string $message)

Accumulate the message.

Details

__construct(string $message = '', array $data = [])

No description

Parameters

string $message
array $data

array getData()

No description

Return Value

array

string getMessage()

No description

Return Value

string

setMessage(string $message)

No description

Parameters

string $message

$this merge(Data $result)

Merge another result into this result. Data already existing in this result takes precedence over the data in the Result being merged.

Parameters

Data $result

Return Value

$this

$this update(ArrayObject $update)

Update the current data with the data provided in the parameter.

Provided data takes precedence.

Parameters

ArrayObject $update

Return Value

$this

array mergeData(array $data)

Merge another result into this result. Data already existing in this result takes precedence over the data in the Result being merged.

$data['message'] is handled specially, and is appended to $this->message if set.

Parameters

array $data

Return Value

array

bool hasExecutionTime()

No description

Return Value

bool

null|float getExecutionTime()

No description

Return Value

null|float

null|float accumulateExecutionTime(array|float $duration)

Accumulate execution time

Parameters

array|float $duration

Return Value

null|float

string accumulateMessage(string $message)

Accumulate the message.

Parameters

string $message

Return Value

string