Collection extends Dictionary
Table of Contents
Constants
- TYPE_FATAL = 'FATAL'
- TYPE_WARNING = 'WARNING'
Methods
- __construct() : mixed
- Creates object.
- __unserialize() : void
- add() : mixed
- Adds a new error to the collection
- addForeignErrors() : mixed
- addWarning() : mixed
- checkHasErrorOfType() : mixed
- checkHasErrors() : bool
- checkHasFatals() : mixed
- checkNoFatals() : mixed
- clear() : mixed
- filter() : Collection
- Filter current collection by some condition
- find() : Collection
- Filter current collection by some condition
- first() : mixed
- get() : string|array<string|int, mixed>|null
- Returns any variable by its name. Null if variable is not set.
- getAll() : array<string|int, mixed>
- getArray() : mixed
- getArrayMeta() : mixed
- getClass() : mixed
- getFatals() : array<string|int, mixed>
- getMessages() : mixed
- getValues() : array<string|int, mixed>
- getWarnings() : array<string|int, mixed>
- isA() : mixed
- isEmpty() : bool
- Returns true if the dictionary is empty.
- jsonSerialize() : array<string|int, mixed>
- JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
- load() : mixed
- Fill current collection from another collection
- makeFromArray() : mixed
- prefixCode() : mixed
- set() : mixed
- setValues() : mixed
- toArray() : array<string|int, mixed>
- Returns the values as an array.
- transform() : mixed
Constants
TYPE_FATAL
public
mixed
TYPE_FATAL
= 'FATAL'
TYPE_WARNING
public
mixed
TYPE_WARNING
= 'WARNING'
Methods
__construct()
Creates object.
public
__construct([array<string|int, mixed>|null $values = null ]) : mixed
Parameters
- $values : array<string|int, mixed>|null = null
__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
add()
Adds a new error to the collection
public
add(string|Error $codeOrInstance[, string $message = '' ][, bool $type = false ][, null $additionalData = null ]) : mixed
todo: provide add() from array todo: provide add() from \Bitrix\Main\Error, with default type == FATAL
Parameters
- $codeOrInstance : string|Error
- $message : string = ''
- $type : bool = false
- $additionalData : null = null
addForeignErrors()
public
addForeignErrors(mixed $other[, array<string|int, mixed> $parameters = array('CHANGE_TYPE_TO' => false) ]) : mixed
Parameters
- $other : mixed
- $parameters : array<string|int, mixed> = array('CHANGE_TYPE_TO' => false)
Tags
addWarning()
public
addWarning(mixed $code[, mixed $message = '' ][, mixed $additionalData = null ]) : mixed
Parameters
- $code : mixed
- $message : mixed = ''
- $additionalData : mixed = null
checkHasErrorOfType()
public
checkHasErrorOfType(mixed $type) : mixed
Parameters
- $type : mixed
checkHasErrors()
public
checkHasErrors() : bool
Use .isEmpty()
Return values
boolcheckHasFatals()
public
checkHasFatals() : mixed
checkNoFatals()
public
checkNoFatals() : mixed
clear()
public
clear() : mixed
filter()
Filter current collection by some condition
public
filter([array<string|int, mixed> $filter = array() ]) : Collection
Parameters
- $filter : array<string|int, mixed> = array()
Return values
Collectionfind()
Filter current collection by some condition
public
find([array<string|int, mixed> $filter = array() ]) : Collection
Parameters
- $filter : array<string|int, mixed> = array()
Return values
Collectionfirst()
public
first() : 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>|nullgetAll()
public
getAll([bool $flat = false ][, null $filter = null ]) : array<string|int, mixed>
Non-architecture-friendly method
Parameters
- $flat : bool = false
- $filter : null = null
Return values
array<string|int, mixed>getArray()
public
getArray() : mixed
getArrayMeta()
public
getArrayMeta() : mixed
getClass()
public
static getClass() : mixed
getFatals()
public
getFatals() : array<string|int, mixed>
Return values
array<string|int, mixed>getMessages()
public
getMessages() : mixed
getValues()
public
getValues() : array<string|int, mixed>
Return values
array<string|int, mixed>getWarnings()
public
getWarnings() : array<string|int, mixed>
Return values
array<string|int, mixed>isA()
public
static isA(mixed $object) : mixed
Parameters
- $object : mixed
isEmpty()
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>load()
Fill current collection from another collection
public
load(mixed $source) : mixed
Parameters
- $source : mixed
makeFromArray()
public
static makeFromArray(array<string|int, mixed> $errors) : mixed
Parameters
- $errors : array<string|int, mixed>
prefixCode()
public
prefixCode(mixed $prefix) : mixed
Parameters
- $prefix : mixed
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>
Return values
array<string|int, mixed>transform()
public
transform([array<string|int, mixed> $rules = array() ]) : mixed
Parameters
- $rules : array<string|int, mixed> = array()