AbstractIndexCollection
in package
implements
CollectionInterface
uses
Serializable
Abstract Index Collection.
Tags
Table of Contents
Interfaces
- CollectionInterface
- Collection Interface.
Properties
- $entries : array<string|int, mixed>
Methods
- __construct() : mixed
- Initializes a new IndexCollection.
- __serialize() : array<string|int, mixed>
- __toString() : string
- Returns a string representation of this object.
- __unserialize() : void
- add() : mixed
- {@inheritDoc}
- chunk() : array<string|int, mixed>
- Split collection into chunks.
- clear() : mixed
- {@inheritDoc}
- contains() : mixed
- {@inheritDoc}
- containsKey() : mixed
- {@inheritDoc}
- count() : mixed
- {@inheritDoc}
- current() : mixed
- {@inheritDoc}
- exists() : mixed
- {@inheritDoc}
- filter() : mixed
- {@inheritDoc}
- first() : mixed
- {@inheritDoc}
- forAll() : mixed
- {@inheritDoc}
- get() : mixed
- {@inheritDoc}
- getIterator() : mixed
- Required by interface IteratorAggregate.
- getKeys() : mixed
- {@inheritDoc}
- getValues() : mixed
- {@inheritDoc}
- indexOf() : mixed
- {@inheritDoc}
- isEmpty() : mixed
- {@inheritDoc}
- jsonSerialize() : array<string|int, mixed>
- Implements JsonSerializable interface.
- key() : mixed
- {@inheritDoc}
- last() : mixed
- {@inheritDoc}
- limit() : static
- map() : mixed
- {@inheritDoc}
- next() : mixed
- {@inheritDoc}
- offsetExists() : bool
- Required by interface ArrayAccess.
- offsetGet() : mixed
- Required by interface ArrayAccess.
- offsetSet() : void
- Required by interface ArrayAccess.
- offsetUnset() : void
- Required by interface ArrayAccess.
- partition() : mixed
- {@inheritDoc}
- remove() : mixed
- {@inheritDoc}
- removeElement() : mixed
- {@inheritDoc}
- reverse() : static
- Reverse the order of the items.
- select() : static
- Select items from collection.
- serialize() : string
- set() : mixed
- {@inheritDoc}
- shuffle() : static
- Shuffle items.
- slice() : mixed
- {@inheritDoc}
- toArray() : mixed
- {@inheritDoc}
- unselect() : static
- Un-select items from collection.
- unserialize() : void
- createFrom() : static
- Creates a new instance from the specified elements.
- getCurrentKey() : string
- getElementMeta() : mixed
- getEntries() : array<string|int, mixed>
- getUnserializeAllowedClasses() : array<string|int, mixed>|bool
- isAllowedElement() : bool
- loadCollection() : CollectionInterface
- loadElement() : mixed|null
- loadElements() : array<string|int, mixed>
- setEntries() : void
Properties
$entries
private
array<string|int, mixed>
$entries
Tags
Methods
__construct()
Initializes a new IndexCollection.
public
__construct([array<string|int, mixed> $entries = [] ]) : mixed
Parameters
- $entries : array<string|int, mixed> = []
Tags
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__toString()
Returns a string representation of this object.
public
__toString() : string
Attributes
- #[ReturnTypeWillChange]
Return values
string__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
add()
{@inheritDoc}
public
add(mixed $element) : mixed
Parameters
- $element : mixed
chunk()
Split collection into chunks.
public
chunk(int $size) : array<string|int, mixed>
Parameters
- $size : int
-
Size of each chunk.
Tags
Return values
array<string|int, mixed>clear()
{@inheritDoc}
public
clear() : mixed
contains()
{@inheritDoc}
public
contains(mixed $element) : mixed
Parameters
- $element : mixed
containsKey()
{@inheritDoc}
public
containsKey(mixed $key) : mixed
Parameters
- $key : mixed
count()
{@inheritDoc}
public
count() : mixed
Attributes
- #[ReturnTypeWillChange]
current()
{@inheritDoc}
public
current() : mixed
Attributes
- #[ReturnTypeWillChange]
exists()
{@inheritDoc}
public
exists(Closure $p) : mixed
Parameters
- $p : Closure
filter()
{@inheritDoc}
public
filter(Closure $p) : mixed
Parameters
- $p : Closure
first()
{@inheritDoc}
public
first() : mixed
forAll()
{@inheritDoc}
public
forAll(Closure $p) : mixed
Parameters
- $p : Closure
get()
{@inheritDoc}
public
get(mixed $key) : mixed
Parameters
- $key : mixed
getIterator()
Required by interface IteratorAggregate.
public
getIterator() : mixed
Tags
Attributes
- #[ReturnTypeWillChange]
getKeys()
{@inheritDoc}
public
getKeys() : mixed
getValues()
{@inheritDoc}
public
getValues() : mixed
indexOf()
{@inheritDoc}
public
indexOf(mixed $element) : mixed
Parameters
- $element : mixed
isEmpty()
{@inheritDoc}
public
isEmpty() : mixed
jsonSerialize()
Implements JsonSerializable interface.
public
jsonSerialize() : array<string|int, mixed>
Attributes
- #[ReturnTypeWillChange]
Return values
array<string|int, mixed>key()
{@inheritDoc}
public
key() : mixed
Attributes
- #[ReturnTypeWillChange]
last()
{@inheritDoc}
public
last() : mixed
limit()
public
limit(int $start[, int|null $limit = null ]) : static
Parameters
- $start : int
- $limit : int|null = null
Tags
Return values
staticmap()
{@inheritDoc}
public
map(Closure $func) : mixed
Parameters
- $func : Closure
next()
{@inheritDoc}
public
next() : mixed
Attributes
- #[ReturnTypeWillChange]
offsetExists()
Required by interface ArrayAccess.
public
offsetExists(string|int|null $offset) : bool
Parameters
- $offset : string|int|null
Tags
Attributes
- #[ReturnTypeWillChange]
Return values
booloffsetGet()
Required by interface ArrayAccess.
public
offsetGet(string|int|null $offset) : mixed
Parameters
- $offset : string|int|null
Tags
Attributes
- #[ReturnTypeWillChange]
offsetSet()
Required by interface ArrayAccess.
public
offsetSet(string|int|null $offset, mixed $value) : void
Parameters
- $offset : string|int|null
- $value : mixed
Tags
Attributes
- #[ReturnTypeWillChange]
offsetUnset()
Required by interface ArrayAccess.
public
offsetUnset(string|int|null $offset) : void
Parameters
- $offset : string|int|null
Tags
Attributes
- #[ReturnTypeWillChange]
partition()
{@inheritDoc}
public
partition(Closure $p) : mixed
Parameters
- $p : Closure
remove()
{@inheritDoc}
public
remove(mixed $key) : mixed
Parameters
- $key : mixed
removeElement()
{@inheritDoc}
public
removeElement(mixed $element) : mixed
Parameters
- $element : mixed
reverse()
Reverse the order of the items.
public
reverse() : static
Tags
Return values
staticselect()
Select items from collection.
public
select(array<string|int, mixed> $keys) : static
Collection is returned in the order of $keys given to the function.
Parameters
- $keys : array<string|int, mixed>
Tags
Return values
staticserialize()
public
final serialize() : string
Return values
stringset()
{@inheritDoc}
public
set(mixed $key, mixed $value) : mixed
Parameters
- $key : mixed
- $value : mixed
shuffle()
Shuffle items.
public
shuffle() : static
Tags
Return values
staticslice()
{@inheritDoc}
public
slice(mixed $offset[, mixed $length = null ]) : mixed
Parameters
- $offset : mixed
- $length : mixed = null
toArray()
{@inheritDoc}
public
toArray() : mixed
unselect()
Un-select items from collection.
public
unselect(array<string|int, mixed> $keys) : static
Parameters
- $keys : array<string|int, mixed>
Tags
Return values
staticunserialize()
public
final unserialize(string $serialized) : void
Parameters
- $serialized : string
createFrom()
Creates a new instance from the specified elements.
protected
createFrom(array<string|int, mixed> $entries) : static
This method is provided for derived classes to specify how a new instance should be created when constructor semantics have changed.
Parameters
- $entries : array<string|int, mixed>
-
Elements.
Tags
Return values
staticgetCurrentKey()
protected
getCurrentKey(FlexObjectInterface $element) : string
Parameters
- $element : FlexObjectInterface
Tags
Return values
stringgetElementMeta()
protected
abstract getElementMeta(mixed $element) : mixed
Parameters
- $element : mixed
getEntries()
protected
getEntries() : array<string|int, mixed>
Return values
array<string|int, mixed>getUnserializeAllowedClasses()
protected
getUnserializeAllowedClasses() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|boolisAllowedElement()
protected
abstract isAllowedElement(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolloadCollection()
protected
abstract loadCollection([array<string|int, mixed>|null $entries = null ]) : CollectionInterface
Parameters
- $entries : array<string|int, mixed>|null = null
Tags
Return values
CollectionInterfaceloadElement()
protected
abstract loadElement(string $key, mixed $value) : mixed|null
Parameters
- $key : string
- $value : mixed
Return values
mixed|nullloadElements()
protected
abstract loadElements([array<string|int, mixed>|null $entries = null ]) : array<string|int, mixed>
Parameters
- $entries : array<string|int, mixed>|null = null
Tags
Return values
array<string|int, mixed>setEntries()
protected
setEntries(array<string|int, mixed> $entries) : void
Parameters
- $entries : array<string|int, mixed>