Result extends Result
Table of Contents
Methods
- __clone() : mixed
- __construct() : mixed
- addError() : $this
- Adds the error.
- addErrors() : $this
- Adds array of Error objects
- createError() : static
- createFromErrorCode() : self
- createOk() : static
- getData() : array<string|int, mixed>
- Returns data array saved into the result.
- getError() : Error|null
- Returns the Error object.
- getErrorCollection() : ErrorCollection
- Returns the error collection.
- getErrorMessages() : array<string|int, string>
- Returns array of strings with error messages
- getErrors() : array<string|int, Error>
- Returns an array of Error objects.
- isSuccess() : bool
- Returns the result status.
- map() : self
- setData() : $this
- Sets data of the result.
Methods
__clone()
public
__clone() : mixed
__construct()
public
__construct() : mixed
addError()
Adds the error.
public
addError(Error $error) : $this
Parameters
- $error : Error
Return values
$thisaddErrors()
Adds array of Error objects
public
addErrors(array<string|int, Error> $errors) : $this
Parameters
- $errors : array<string|int, Error>
Return values
$thiscreateError()
public
static createError(Error $error) : static
Parameters
- $error : Error
Return values
staticcreateFromErrorCode()
public
static createFromErrorCode(string $code[, mixed $customData = null ]) : self
Parameters
- $code : string
- $customData : mixed = null
Return values
selfcreateOk()
public
static createOk([array<string|int, mixed>|null $data = null ]) : static
Parameters
- $data : array<string|int, mixed>|null = null
Return values
staticgetData()
Returns data array saved into the result.
public
getData() : array<string|int, mixed>
Return values
array<string|int, mixed>getError()
Returns the Error object.
public
getError() : Error|null
Return values
Error|nullgetErrorCollection()
Returns the error collection.
public
getErrorCollection() : ErrorCollection
Return values
ErrorCollectiongetErrorMessages()
Returns array of strings with error messages
public
getErrorMessages() : array<string|int, string>
Return values
array<string|int, string>getErrors()
Returns an array of Error objects.
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error>isSuccess()
Returns the result status.
public
isSuccess() : bool
Return values
boolmap()
public
map(callable $callback) : self
Parameters
- $callback : callable
Return values
selfsetData()
Sets data of the result.
public
setData(array<string|int, mixed> $data) : $this
Parameters
- $data : array<string|int, mixed>