Collection implements ArrayAccess, Iterator, Countable
Collection of entity objects. Used to hold 1:N and N:M object collections.
Tags
Table of Contents
Interfaces
- ArrayAccess
- Iterator
- Countable
Constants
- OBJECT_ADDED = 1
- OBJECT_REMOVED = 2
Properties
- $dataClass : DataManager
- Entity Table class. Read-only property.
- $entity : Entity
Methods
- __call() : array<string|int, mixed>
- Magic to handle getters, setters etc.
- __clone() : mixed
- __construct() : mixed
- Collection constructor.
- __get() : array<string|int, mixed>|Entity
- Magic read-only properties
- __set() : mixed
- Magic read-only properties
- add() : mixed
- collectValues() : array<string|int, mixed>
- Returns all values of collection objects as an array.
- count() : int
- Countable implementation
- current() : EntityObject|mixed
- Iterator implementation
- fill() : array<string|int, mixed>|Collection|null
- Fills all the values and relations of object
- getAll() : array<string|int, EntityObject>
- getByPrimary() : EntityObject
- has() : bool
- hasByPrimary() : bool
- isEmpty() : bool
- key() : mixed
- Iterator implementation
- merge() : self
- next() : void
- Iterator implementation
- offsetExists() : bool
- ArrayAccess implementation
- offsetGet() : mixed|void
- ArrayAccess implementation
- offsetSet() : void
- ArrayAccess implementation
- offsetUnset() : void
- ArrayAccess implementation
- remove() : void
- removeByPrimary() : mixed
- rewind() : void
- Iterator implementation
- save() : mixed
- sysOnObjectPrimarySet() : mixed
- Callback for object event when it gets primary
- sysRemove() : mixed
- valid() : bool
- Iterator implementation
- wakeUp() : array<string|int, mixed>|static
- Constructs set of existing objects from pre-selected data, including references and relations.
Constants
OBJECT_ADDED
public
int
OBJECT_ADDED
= 1
Code for $objectsChanged
OBJECT_REMOVED
public
int
OBJECT_REMOVED
= 2
Code for $objectsChanged
Properties
$dataClass
Entity Table class. Read-only property.
public
static DataManager
$dataClass
$entity read-only
public
Entity
$entity
Methods
__call()
Magic to handle getters, setters etc.
public
__call(mixed $name, mixed $arguments) : array<string|int, mixed>
Parameters
- $name : mixed
- $arguments : mixed
Tags
Return values
array<string|int, mixed>__clone()
public
__clone() : mixed
__construct()
Collection constructor.
public
final __construct([Entity $entity = null ]) : mixed
Parameters
- $entity : Entity = null
Tags
__get()
Magic read-only properties
public
__get(mixed $name) : array<string|int, mixed>|Entity
Parameters
- $name : mixed
Tags
Return values
array<string|int, mixed>|Entity__set()
Magic read-only properties
public
__set(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
Tags
add()
public
final add(EntityObject $object) : mixed
Parameters
- $object : EntityObject
Tags
collectValues()
Returns all values of collection objects as an array.
public
final collectValues([int $valuesType = Values::ALL ][, int $fieldsMask = FieldTypeMask::ALL ][, bool $recursive = false ]) : array<string|int, mixed>
Parameters
- $valuesType : int = Values::ALL
- $fieldsMask : int = FieldTypeMask::ALL
- $recursive : bool = false
Tags
Return values
array<string|int, mixed>count()
Countable implementation
public
count() : int
Return values
intcurrent()
Iterator implementation
public
current() : EntityObject|mixed
Attributes
- #[ReturnTypeWillChange]
Return values
EntityObject|mixedfill()
Fills all the values and relations of object
public
final fill([int|array<string|int, string> $fields = FieldTypeMask::ALL ]) : array<string|int, mixed>|Collection|null
Parameters
- $fields : int|array<string|int, string> = FieldTypeMask::ALL
-
Names of fields to fill
Tags
Return values
array<string|int, mixed>|Collection|nullgetAll()
public
final getAll() : array<string|int, EntityObject>
Return values
array<string|int, EntityObject>getByPrimary()
public
final getByPrimary(mixed $primary) : EntityObject
Parameters
- $primary : mixed
Tags
Return values
EntityObjecthas()
public
final has(EntityObject $object) : bool
Parameters
- $object : EntityObject
Tags
Return values
boolhasByPrimary()
public
final hasByPrimary(mixed $primary) : bool
Parameters
- $primary : mixed
Tags
Return values
boolisEmpty()
public
isEmpty() : bool
Return values
boolkey()
Iterator implementation
public
key() : mixed
Attributes
- #[ReturnTypeWillChange]
merge()
public
merge(self|null $collection) : self
Parameters
- $collection : self|null
Tags
Return values
selfnext()
Iterator implementation
public
next() : void
offsetExists()
ArrayAccess implementation
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Tags
Return values
booloffsetGet()
ArrayAccess implementation
public
offsetGet(mixed $offset) : mixed|void
Parameters
- $offset : mixed
Tags
Attributes
- #[ReturnTypeWillChange]
Return values
mixed|voidoffsetSet()
ArrayAccess implementation
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
Tags
offsetUnset()
ArrayAccess implementation
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
Tags
remove()
public
final remove(EntityObject $object) : void
Parameters
- $object : EntityObject
Tags
removeByPrimary()
public
final removeByPrimary(mixed $primary) : mixed
Parameters
- $primary : mixed
Tags
rewind()
Iterator implementation
public
rewind() : void
save()
public
final save([mixed $ignoreEvents = false ]) : mixed
Parameters
- $ignoreEvents : mixed = false
sysOnObjectPrimarySet()
Callback for object event when it gets primary
public
sysOnObjectPrimarySet(mixed $object) : mixed
Parameters
- $object : mixed
sysRemove()
public
sysRemove(mixed $srPrimary) : mixed
Parameters
- $srPrimary : mixed
valid()
Iterator implementation
public
valid() : bool
Return values
boolwakeUp()
Constructs set of existing objects from pre-selected data, including references and relations.
public
final static wakeUp(mixed $rows) : array<string|int, mixed>|static
Parameters
- $rows : mixed