SimpleCollection
class SimpleCollection implements CollectionInterface
Collection This class provides a common interface used by many other classes in a Inhere\Library application that manage "collections" of data that must be inspected and/or manipulated
Properties
protected array | $data | The source data |
Methods
No description
Create new collection
No description
Set collection item
No description
Get collection item for key
Add item to collection
No description
No description
No description
No description
No description
Get all items in collection
No description
Get collection keys
Does this collection have a given key?
Remove item from collection
Remove all items from collection
Does this collection have a given key?
Get collection item for key
Set collection item
Remove item from collection
Get number of items in collection
No description
No description
No description
Get collection iterator
No description
No description
No description
Details
at line 26
static SimpleCollection
make(array|null $items = null)
at line 35
__construct(array $items = [])
Create new collection
at line 40
__destruct()
at line 55
set($key, $value)
Set collection item
at line 67
$this
add($name, $value)
at line 82
get(string $key, $default = null)
Get collection item for key
at line 91
replace(array $items)
Add item to collection
at line 102
array
gets(array $names)
at line 117
SimpleCollection
sets(array $data)
at line 130
SimpleCollection
reject(callable $filter)
at line 149
SimpleCollection
map(callable $callback)
at line 165
string
implode(string $char = ',')
at line 174
array
all()
Get all items in collection
at line 182
array
toArray()
at line 191
array
keys()
Get collection keys
at line 201
bool
has(string $key)
Does this collection have a given key?
at line 211
mixed
remove($key)
Remove item from collection
at line 226
clear()
Remove all items from collection
at line 240
bool
offsetExists(string $key)
Does this collection have a given key?
at line 250
mixed
offsetGet(string $key)
Get collection item for key
at line 260
offsetSet(string $key, mixed $value)
Set collection item
at line 270
mixed|null
offsetUnset(string $key)
Remove item from collection
at line 283
int
count()
Get number of items in collection
at line 295
array
jsonSerialize()
at line 307
string
serialize()
at line 316
unserialize(string $serialized, bool|array $allowedClasses = false)
at line 329
ArrayIterator
getIterator()
Get collection iterator