ComplexCollection extends Dictionary
Class ComplexCollection
Table of Contents
Methods
- __construct() : mixed
- Constructor ComplexCollection.
- __unserialize() : void
- add() : void
- Add an array of complex identificators to the collection.
- addIdentificator() : void
- Add entity to the collection.
- clear() : mixed
- diff() : static
- Computes the difference of this and argument collections.
- get() : string|array<string|int, mixed>|null
- Returns any variable by its name. Null if variable is not set.
- getComplexByTypeId() : Complex|null
- Get first complex identificator by type ID.
- getIdByTypeId() : int|null
- Get first ID by type ID.
- getValues() : array<string|int, mixed>
- hasComplex() : bool
- Return true if collection has complex identificator.
- 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
- \ArrayAccess thing.
- set() : mixed
- setComplex() : void
- Add an complex identificator to the collection.
- setValues() : mixed
- toArray() : array<string|int, Complex>
- Convert to array.
- toSimpleArray() : array<string|int, mixed>
- Convert to array of identificators.
Methods
__construct()
Constructor ComplexCollection.
public
__construct([array<string|int, Complex> $values = null ]) : mixed
Parameters
- $values : array<string|int, Complex> = null
-
Initial entities in the collection.
__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
add()
Add an array of complex identificators to the collection.
public
add(array<string|int, Complex> $items[, bool $uniqueOnly = false ]) : void
Parameters
- $items : array<string|int, Complex>
-
Complex identificators.
- $uniqueOnly : bool = false
-
Add unique entity only.
addIdentificator()
Add entity to the collection.
public
addIdentificator(int|null $entityTypeId, int|null $entityId[, bool $uniqueOnly = false ]) : void
Parameters
- $entityTypeId : int|null
-
Entity type ID.
- $entityId : int|null
-
Entity ID.
- $uniqueOnly : bool = false
-
Add unique entity only.
clear()
public
clear() : mixed
diff()
Computes the difference of this and argument collections.
public
diff(ComplexCollection $collection) : static
Compares $this against $collection and returns the values in $this that are not present in $collection.
Parameters
- $collection : ComplexCollection
-
Collection.
Return values
staticget()
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>|nullgetComplexByTypeId()
Get first complex identificator by type ID.
public
getComplexByTypeId(int $typeId) : Complex|null
Parameters
- $typeId : int
-
Type ID.
Return values
Complex|nullgetIdByTypeId()
Get first ID by type ID.
public
getIdByTypeId(int $typeId) : int|null
Parameters
- $typeId : int
-
Type ID.
Return values
int|nullgetValues()
public
getValues() : array<string|int, mixed>
Return values
array<string|int, mixed>hasComplex()
Return true if collection has complex identificator.
public
hasComplex(Complex $comparableComplex) : bool
Parameters
- $comparableComplex : Complex
-
Comparable complex identificator.
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()
\ArrayAccess thing.
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
set()
public
set(mixed $name[, mixed $value = null ]) : mixed
Parameters
- $name : mixed
- $value : mixed = null
setComplex()
Add an complex identificator to the collection.
public
setComplex(Complex $complex[, bool $uniqueOnly = false ][, int $offset = null ]) : void
Parameters
- $complex : Complex
-
An entity object.
- $uniqueOnly : bool = false
-
Add unique entity only.
- $offset : int = null
-
Offset in the array.
setValues()
public
setValues(mixed $values) : mixed
Parameters
- $values : mixed
toArray()
Convert to array.
public
toArray() : array<string|int, Complex>
Return values
array<string|int, Complex>toSimpleArray()
Convert to array of identificators.
public
toSimpleArray([array<string|int, mixed> $keys = ['ENTITY_TYPE_ID', 'ENTITY_ID'] ]) : array<string|int, mixed>
Parameters
- $keys : array<string|int, mixed> = ['ENTITY_TYPE_ID', 'ENTITY_ID']
-
Keys of array.