Collection extends Registry implements ActiveRecordCollection
AbstractYes
Tags
Table of Contents
Interfaces
Methods
- __construct() : mixed
- add() : static
- Append collection with new item.
- delete() : Result
- Delete from the database all entities that are in the registry and have an id
- filter() : $this
- find() : static
- getAny() : T|null
- getCollectionElementClass() : string|ActiveRecord
- Returns collection item's class name.
- getDataClass() : string|DataManager
- Returns ORM tablet class name.
- getDataEntityCollection() : Collection
- Before external call, call prepare method to update the state of the entity @see BaseLinkCollection::prepareFields()
- getPrimaryIds() : array<string|int, int>
- hasUnsaved() : bool
- load() : Result
- Restores object state from database.
- merge() : static
- offsetSet() : void
- Alias to add method.
- save() : Result
- Saves collection objects states into database.
- unsetByKeys() : void
Methods
__construct()
public
__construct([mixed $source = null ]) : mixed
Parameters
- $source : mixed = null
add()
Append collection with new item.
public
add(ActiveRecord $entry) : static
Parameters
- $entry : ActiveRecord
Tags
Return values
staticdelete()
Delete from the database all entities that are in the registry and have an id
public
delete() : Result
Return values
Resultfilter()
public
filter(callable $predicate) : $this
Parameters
- $predicate : callable
Return values
$thisfind()
public
abstract static find(array<string|int, mixed> $filter, array<string|int, mixed> $order[, int|null $limit = null ][, Context|null $context = null ]) : static
Parameters
- $filter : array<string|int, mixed>
- $order : array<string|int, mixed>
- $limit : int|null = null
- $context : Context|null = null
Return values
staticgetAny()
public
getAny() : T|null
Return values
T|nullgetCollectionElementClass()
Returns collection item's class name.
public
abstract static getCollectionElementClass() : string|ActiveRecord
Return values
string|ActiveRecordgetDataClass()
Returns ORM tablet class name.
public
final static getDataClass() : string|DataManager
Return values
string|DataManagergetDataEntityCollection()
Before external call, call prepare method to update the state of the entity @see BaseLinkCollection::prepareFields()
public
getDataEntityCollection() : Collection
Return values
CollectiongetPrimaryIds()
public
getPrimaryIds() : array<string|int, int>
Return values
array<string|int, int>hasUnsaved()
public
hasUnsaved() : bool
Return values
boolload()
Restores object state from database.
public
load(array<string|int, int>|array<string|int, mixed>|Collection $source) : Result
Parameters
- $source : array<string|int, int>|array<string|int, mixed>|Collection
Return values
Resultmerge()
public
merge(Registry<string|int, T> $registry) : static
Parameters
- $registry : Registry<string|int, T>
Return values
staticoffsetSet()
Alias to add method.
public
offsetSet(mixed $offset, mixed $entry) : void
Parameters
- $offset : mixed
- $entry : mixed
save()
Saves collection objects states into database.
public
save([bool $isGroupSave = false ]) : Result
Parameters
- $isGroupSave : bool = false
Return values
ResultunsetByKeys()
public
unsetByKeys(array<string|int, mixed> $keys) : void
Parameters
- $keys : array<string|int, mixed>