Documentation

Collection
in package
implements ArrayAccess, IteratorAggregate, Countable

Table of Contents

Interfaces

ArrayAccess
IteratorAggregate
Countable

Properties

$_container  : AbstractForm
Elements container
$_elements  : array<string|int, mixed>
Elements storage

Methods

__construct()  : mixed
Class constructor
add()  : AbstractElement
Add element to collection
count()  : int
Count elements in collection
getIterator()  : ArrayIterator
Implementation of IteratorAggregate::getIterator()
offsetExists()  : bool
Implementation of ArrayAccess:offsetExists()
offsetGet()  : mixed
Implementation of ArrayAccess:offsetGet()
offsetSet()  : void
Implementation of ArrayAccess:offsetSet()
offsetUnset()  : void
Implementation of ArrayAccess:offsetUnset()
remove()  : self
Remove element from collection
searchById()  : AbstractElement|null
Find element by ID
usort()  : self
Sort elements by values using a user-defined comparison function

Properties

$_elements

Elements storage

private array<string|int, mixed> $_elements

Methods

count()

Count elements in collection

public count() : int
Attributes
#[Override]
Return values
int

getIterator()

Implementation of IteratorAggregate::getIterator()

public getIterator() : ArrayIterator
Attributes
#[Override]
Return values
ArrayIterator

offsetExists()

Implementation of ArrayAccess:offsetExists()

public offsetExists(mixed $key) : bool
Parameters
$key : mixed
Attributes
#[Override]
Return values
bool

offsetGet()

Implementation of ArrayAccess:offsetGet()

public offsetGet(mixed $key) : mixed
Parameters
$key : mixed
Attributes
#[Override]
#[ReturnTypeWillChange]

offsetSet()

Implementation of ArrayAccess:offsetSet()

public offsetSet(mixed $key, mixed $value) : void
Parameters
$key : mixed
$value : mixed
Attributes
#[Override]

offsetUnset()

Implementation of ArrayAccess:offsetUnset()

public offsetUnset(mixed $key) : void
Parameters
$key : mixed
Attributes
#[Override]

remove()

Remove element from collection

public remove(mixed $elementId) : self
Parameters
$elementId : mixed
Return values
self

usort()

Sort elements by values using a user-defined comparison function

public usort(mixed $callback) : self
Parameters
$callback : mixed
Return values
self
On this page

Search results