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
$_container
Elements container
private
AbstractForm
$_container
$_elements
Elements storage
private
array<string|int, mixed>
$_elements
Methods
__construct()
Class constructor
public
__construct(AbstractForm $container) : mixed
Parameters
- $container : AbstractForm
add()
Add element to collection
public
add(AbstractElement $element[, string|false $after = false ]) : AbstractElement
Parameters
- $element : AbstractElement
- $after : string|false = false
Tags
Return values
AbstractElementcount()
Count elements in collection
public
count() : int
Attributes
- #[Override]
Return values
intgetIterator()
Implementation of IteratorAggregate::getIterator()
public
getIterator() : ArrayIterator
Attributes
- #[Override]
Return values
ArrayIteratoroffsetExists()
Implementation of ArrayAccess:offsetExists()
public
offsetExists(mixed $key) : bool
Parameters
- $key : mixed
Attributes
- #[Override]
Return values
booloffsetGet()
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
selfsearchById()
Find element by ID
public
searchById(mixed $elementId) : AbstractElement|null
Parameters
- $elementId : mixed
Return values
AbstractElement|nullusort()
Sort elements by values using a user-defined comparison function
public
usort(mixed $callback) : self
Parameters
- $callback : mixed