abstract class AbstractCollection implements Iterator, Countable

Class AbstractCollection

Properties

protected array $items
protected int $index

Methods

__construct(array|null $items = [])

AbstractCollection constructor.

setItems(array|null $items = [])

No description

addItem($item)

No description

mixed
parseItem($item)

No description

string
toJson()

No description

array
toArray()

No description

string
__toString()

No description

int
position()

Return the current position of the index

mixed|null
first()

Move index to first position and return current element

mixed|null
get(int $index)

No description

mixed|null
seek(int|null $index = 0)

Move the index at the specified position

int
count()

No description

int
getLastIndex()

No description

mixed|null
last()

Move index at the end of collection and return current element

mixed|null
current()

No description

mixed|null
next()

Move index to next position and return current element

mixed|null
key()

Return current key/index

mixed|null
valid()

Return current key/index

mixed|null
rewind()

Move index to first position and return current element

Details

at line 35
__construct(array|null $items = [])

AbstractCollection constructor.

Parameters

array|null $items

at line 46
protected AbstractCollection setItems(array|null $items = [])

Parameters

array|null $items

Return Value

AbstractCollection

at line 63
AbstractCollection addItem($item)

Parameters

$item

Return Value

AbstractCollection

at line 77
protected mixed parseItem($item)

Parameters

$item

Return Value

mixed

at line 86
string toJson()

Return Value

string

at line 95
array toArray()

Return Value

array

at line 104
string __toString()

Return Value

string

at line 115
int position()

Return the current position of the index

Return Value

int

at line 126
mixed|null first()

Move index to first position and return current element

Return Value

mixed|null

at line 137
mixed|null get(int $index)

Parameters

int $index

Return Value

mixed|null

at line 150
mixed|null seek(int|null $index = 0)

Move the index at the specified position

Parameters

int|null $index

Return Value

mixed|null

at line 161
int count()

Return Value

int

at line 170
int getLastIndex()

Return Value

int

at line 183
mixed|null last()

Move index at the end of collection and return current element

Return Value

mixed|null

at line 193
mixed|null current()

Return Value

mixed|null

at line 204
mixed|null next()

Move index to next position and return current element

Return Value

mixed|null

at line 215
mixed|null key()

Return current key/index

Return Value

mixed|null

at line 226
mixed|null valid()

Return current key/index

Return Value

mixed|null

at line 237
mixed|null rewind()

Move index to first position and return current element

Return Value

mixed|null