BaseMap
abstract class BaseMap extends BaseCollection implements ArrayAccess, IteratorAggregate
Abstract base class to represent hashmaps / associative arrays / dictionaries.
It also provides a concrete implementation for ArrayAccess interface.
Traits
Constants
| CB_ZERO_ARG |
|
Methods
Determines if at least an element of the collection satisfies a condition.
Determines if all elements of the collection satisfies a condition.
Create a new collection instance from the specified iterable.
Get the value at the specified key.
Get the value at the specified key.
This method returns the instance itself, so you can use it in fluent pattern.
Determine if the specified key exists.
Determine if the specified value exists.
No description
No description
Assign a value to the specified offset
No description
Details
in
WithCollection at line 12
abstract int
count()
No description
in
WithCollection at line 13
abstract array
toArray()
No description
in
WithCollection at line 15
mixed
first()
No description
in
WithCollection at line 23
mixed
firstOr(mixed $default)
No description
in
WithCollection at line 45
bool
any(callable $callable)
Determines if at least an element of the collection satisfies a condition.
The execution of callbacks stop after a callable returned true.
in
WithCollection at line 78
bool
all(callable $callable)
Determines if all elements of the collection satisfies a condition.
The execution of callbacks stop after a callable returned false.
in
BaseCollection at line 24
abstract static BaseCollection
from(iterable $items)
Create a new collection instance from the specified iterable.
in
BaseCollection at line 59
abstract bool
isEmpty()
Determine if a collection is empty.
at line 28
abstract mixed
get(mixed $key)
Get the value at the specified key.
at line 38
abstract mixed
getOr(mixed $key, mixed $defaultValue)
Get the value at the specified key.
at line 50
abstract BaseMap
set(mixed $key, mixed $value)
Set the specified value at the specified key.
This method returns the instance itself, so you can use it in fluent pattern.
at line 59
abstract BaseMap
unset(mixed $key)
This method returns the instance itself, so you can use it in fluent pattern.
at line 68
abstract bool
has(mixed $key)
Determine if the specified key exists.
at line 77
abstract bool
contains(mixed $value)
Determine if the specified value exists.
at line 90
bool
offsetExists(mixed $offset)
No description
at line 100
mixed
offsetGet(mixed $offset)
No description
at line 112
void
offsetSet(mixed $offset, mixed $value)
Assign a value to the specified offset
at line 121
void
offsetUnset(mixed $offset)
No description