ArrayList
in package
implements
ArrayAccess, Countable, IteratorAggregate
uses
SmartObject
Provides the base class for a generic list (items can be accessed by index).
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- IteratorAggregate
Properties
- $list : array<string|int, mixed>
Methods
- __call() : mixed
- __callStatic() : mixed
- __get() : mixed
- __isset() : bool
- __set() : void
- __unset() : void
- count() : int
- Returns items count.
- from() : static
- Transforms array to ArrayList.
- getIterator() : Iterator<int, T>
- Returns an iterator over all items.
- offsetExists() : bool
- Determines whether a item exists.
- offsetGet() : T
- Returns a item.
- offsetSet() : void
- Replaces or appends a item.
- offsetUnset() : void
- Removes the element at the specified position in this list.
- prepend() : void
- Prepends a item.
Properties
$list
private
array<string|int, mixed>
$list
= []
Methods
__call()
public
__call(string $name, array<string|int, mixed> $args) : mixed
Parameters
- $name : string
- $args : array<string|int, mixed>
Tags
__callStatic()
public
static __callStatic(string $name, array<string|int, mixed> $args) : mixed
Parameters
- $name : string
- $args : array<string|int, mixed>
Tags
__get()
public
& __get(string $name) : mixed
Parameters
- $name : string
Tags
__isset()
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__set()
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
Tags
__unset()
public
__unset(string $name) : void
Parameters
- $name : string
Tags
count()
Returns items count.
public
count() : int
Return values
intfrom()
Transforms array to ArrayList.
public
static from(array<int, T> $array) : static
Parameters
- $array : array<int, T>
Return values
staticgetIterator()
Returns an iterator over all items.
public
& getIterator() : Iterator<int, T>
Return values
Iterator<int, T>offsetExists()
Determines whether a item exists.
public
offsetExists(int $index) : bool
Parameters
- $index : int
Return values
booloffsetGet()
Returns a item.
public
offsetGet(int $index) : T
Parameters
- $index : int
Tags
Return values
ToffsetSet()
Replaces or appends a item.
public
offsetSet(int|null $index, T $value) : void
Parameters
- $index : int|null
- $value : T
Tags
offsetUnset()
Removes the element at the specified position in this list.
public
offsetUnset(int $index) : void
Parameters
- $index : int
Tags
prepend()
Prepends a item.
public
prepend(T $value) : void
Parameters
- $value : T