Documentation

ArrayList
in package
implements ArrayAccess, Countable, IteratorAggregate uses SmartObject

Provides the base class for a generic list (items can be accessed by index).

Tags
template
implements
implements

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
throws
MemberAccessException

__callStatic()

public static __callStatic(string $name, array<string|int, mixed> $args) : mixed
Parameters
$name : string
$args : array<string|int, mixed>
Tags
throws
MemberAccessException

__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
throws
MemberAccessException

if the property is not defined or is read-only

count()

Returns items count.

public count() : int
Return values
int

from()

Transforms array to ArrayList.

public static from(array<int, T$array) : static
Parameters
$array : array<int, T>
Return values
static

getIterator()

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
bool

offsetSet()

Replaces or appends a item.

public offsetSet(int|null $index, T $value) : void
Parameters
$index : int|null
$value : T
Tags
throws
OutOfRangeException

offsetUnset()

Removes the element at the specified position in this list.

public offsetUnset(int $index) : void
Parameters
$index : int
Tags
throws
OutOfRangeException

prepend()

Prepends a item.

public prepend(T $value) : void
Parameters
$value : T

        
On this page

Search results