37 $this->replace($items);
50 public function set(
$key, $value)
63 public function get(
$key, $default =
null)
75 foreach ($items as
$key => $value) {
76 $this->
set(
$key, $value);
97 return array_keys($this->
data);
109 return array_key_exists(
$key, $this->
data);
143 return $this->has(
$key);
155 return $this->
get(
$key);
166 $this->
set(
$key, $value);
186 return count($this->
data);
200 return new ArrayIterator($this->
data);
An exception for terminatinating execution or to throw for unit testing.
replace(array $items)
Add item to collection, replacing existing items with the same data key.
count()
Get number of items in collection.
keys()
Get collection keys.
clear()
Remove all items from collection.
all()
Get all items in collection.
offsetExists($key)
Does this collection have a given key?
offsetUnset($key)
Remove item from collection.
getIterator()
Get collection iterator.
offsetGet($key)
Get collection item for key.
has($key)
Does this collection have a given key?
__construct(array $items=[])
Create new collection.
offsetSet($key, $value)
Set collection item.
Slim Framework (https://slimframework.com)