ErrorCollection extends Dictionary
FinalYes
Table of Contents
Methods
- __construct() : mixed
- Constructor ErrorCollection.
- __unserialize() : void
- add() : void
- Adds array of errors to collection.
- addFromResult() : void
- Adds errors from Main\Entity\Result.
- addOne() : void
- Adds one error to collection.
- clear() : mixed
- get() : string|array<string|int, mixed>|null
- Returns any variable by its name. Null if variable is not set.
- getErrorByCode() : array<string|int, Error>
- Getting once error with the necessary code.
- getErrorsByCode() : array<string|int, Error>
- Getting array of errors with the necessary code.
- getValues() : array<string|int, mixed>
- hasErrors() : bool
- Returns true if collection has errors.
- isEmpty() : bool
- Returns true if the dictionary is empty.
- jsonSerialize() : array<string|int, mixed>
- JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
- offsetSet() : void
- Offset to set error.
- set() : mixed
- setValues() : mixed
- toArray() : array<string|int, mixed>
- Returns the values as an array.
Methods
__construct()
Constructor ErrorCollection.
public
__construct([array<string|int, mixed> $values = null ]) : mixed
Parameters
- $values : array<string|int, mixed> = null
-
Errors which need to add in collection.
Tags
__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
add()
Adds array of errors to collection.
public
add(array<string|int, Error> $errors) : void
Parameters
- $errors : array<string|int, Error>
-
Array of errors.
addFromResult()
Adds errors from Main\Entity\Result.
public
addFromResult(Result $result) : void
Parameters
- $result : Result
-
Result after action in Entity.
addOne()
Adds one error to collection.
public
addOne(Error $error) : void
Parameters
- $error : Error
-
Error object.
clear()
public
clear() : mixed
get()
Returns any variable by its name. Null if variable is not set.
public
get(string $name) : string|array<string|int, mixed>|null
Parameters
- $name : string
Return values
string|array<string|int, mixed>|nullgetErrorByCode()
Getting once error with the necessary code.
public
getErrorByCode(string $code) : array<string|int, Error>
Parameters
- $code : string
-
Code of error.
Return values
array<string|int, Error>getErrorsByCode()
Getting array of errors with the necessary code.
public
getErrorsByCode(string $code) : array<string|int, Error>
Parameters
- $code : string
-
Code of error.
Return values
array<string|int, Error>getValues()
public
getValues() : array<string|int, mixed>
Return values
array<string|int, mixed>hasErrors()
Returns true if collection has errors.
public
hasErrors() : bool
Return values
boolisEmpty()
Returns true if the dictionary is empty.
public
isEmpty() : bool
Return values
booljsonSerialize()
JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
public
jsonSerialize() : array<string|int, mixed>
Attributes
- #[ReturnTypeWillChange]
Return values
array<string|int, mixed>offsetSet()
Offset to set error.
public
offsetSet(Error $offset, string|int $value) : void
Parameters
- $offset : Error
-
Offset.
- $value : string|int
-
Error.
Tags
set()
public
set(mixed $name[, mixed $value = null ]) : mixed
Parameters
- $name : mixed
- $value : mixed = null
setValues()
public
setValues(mixed $values) : mixed
Parameters
- $values : mixed
toArray()
Returns the values as an array.
public
toArray() : array<string|int, mixed>