rex_instance_list_pool_trait
Instance List Pool Trait.
Tags
Table of Contents
Methods
- clearInstanceList() : void
- Clears the instance list of the given key.
- clearInstanceListPool() : void
- Clears the instance list pool.
- addInstanceList() : void
- Adds an instance list.
- getInstanceList() : array<string|int, mixed>
- Returns the instance list for the given key.
- hasInstanceList() : bool
- Checks whether an instance list exists for the given key.
Methods
clearInstanceList()
Clears the instance list of the given key.
public
static clearInstanceList(mixed $key) : void
Parameters
- $key : mixed
-
Key
clearInstanceListPool()
Clears the instance list pool.
public
static clearInstanceListPool() : void
addInstanceList()
Adds an instance list.
protected
static addInstanceList(mixed $key, array<string|int, mixed> $instanceKeyList) : void
Parameters
- $key : mixed
-
Key
- $instanceKeyList : array<string|int, mixed>
-
Array of instance keys
getInstanceList()
Returns the instance list for the given key.
protected
static getInstanceList(mixed $key, callable $getInstanceCallback[, callable|null $createListCallback = null ]) : array<string|int, mixed>
If the instance list does not exist it will be created by calling the $createListCallback
Parameters
- $key : mixed
-
Key
- $getInstanceCallback : callable
-
Callback, will be called for every list item to get the instance
- $createListCallback : callable|null = null
-
Callback, will be called to create the list of instance keys
Tags
Return values
array<string|int, mixed>hasInstanceList()
Checks whether an instance list exists for the given key.
protected
static hasInstanceList(mixed $key) : bool
Parameters
- $key : mixed
-
Key