ListInterface
extends
Iterator, JsonSerializable, Countable
in
ListInterface
Tags
Table of Contents
Methods
- append() : void
- Appends a list to another.
- first() : mixed
- Get the first value of list
- get() : mixed
- Get a value by it's key
- has() : bool
- Check if a given key exists on list
- last() : mixed
- Get the last value of list
- push() : void
- Add a value to list
- put() : void
- Put a object into list on given key
- remove() : mixed
- Remove a value by it's key on list
- toArray() : array<string|int, mixed>
- Return an array representation for list
- values() : array<string|int, mixed>
- Return an array with list values only
Methods
append()
Appends a list to another.
public
append(ListInterface $list) : void
Parameters
- $list : ListInterface
-
ListInterface object to append.
first()
Get the first value of list
public
first() : mixed
get()
Get a value by it's key
public
get( $key) : mixed
Parameters
has()
Check if a given key exists on list
public
has( $key) : bool
Parameters
Return values
bool —True if key exists, false otherwise.
last()
Get the last value of list
public
last() : mixed
push()
Add a value to list
public
push(mixed $value) : void
Parameters
- $value : mixed
-
Value to add.
put()
Put a object into list on given key
public
put(string|int $key, mixed $value) : void
Parameters
- $key : string|int
-
Key for manage the value.
- $value : mixed
-
Value to add.
remove()
Remove a value by it's key on list
public
remove( $key) : mixed
Parameters
toArray()
Return an array representation for list
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>values()
Return an array with list values only
public
values() : array<string|int, mixed>