Collection
class Collection extends Collection (View source)
Properties
| protected array | $storage | The collection store |
from Collection |
Methods
No description
Get the first item of storage
To retrieve a value or value collection form instance of collection.
Check existence of a key in the session collection
Merge the collection with a painting or other collection
No description
Returns the key list and return an instance of Collection.
Ignore the key that is given to it and return an instance of Collection.
Update an existing value in the collection
Add after the last item in the collection
Allows to recover a value or value collection.
No description
No description
No description
Modify an entry in the collection or the addition if not
Details
__construct(array $storage = [])
No description
mixed
first()
Get the first item of storage
mixed
last()
The last element of the list
bool
isEmpty()
Check if a collection is empty.
int
length()
Length of the collection
Collection
values()
Get the list of values of collection
Collection
keys()
Get the list of keys of collection
int
count()
Count the collection element.
Collection
chunk(int $chunk)
Chunk the storage content
Collection
collectify(string $key)
To retrieve a value or value collection form instance of collection.
bool
has(int|string $key, bool $strict = false)
Check existence of a key in the session collection
void
each(callable $cb)
Browse all the values of the collection
Collection
merge(Collection|array $array)
Merge the collection with a painting or other collection
array
toArray()
No description
Collection
map(callable $cb)
Map
Collection
filter(callable $cb)
Filter
array
fill(mixed $data, int $offset)
Fill storage
Collection
reduce(callable $cb, mixed $next = null)
Reduce
string
implode(string $sep)
Implode
int|float
sum(callable|null $cb = null)
Sum
int|float
max(callable|null $cb = null)
Max
float|int
min(callable|null $cb = null)
Max
Collection
excepts(array $except)
Returns the key list and return an instance of Collection.
Collection
ignores(array $ignores)
Ignore the key that is given to it and return an instance of Collection.
Collection
reverse()
Reverse collection
bool
update(mixed $key, mixed $data, bool $override = false)
Update an existing value in the collection
Generator
yieldify()
Launches the collection content as generator
mixed
shift()
Deletes the first item in the collection
mixed
pop()
Deletes the last item in the collection
array
all()
Returns the elements of the collection
Collection
push(mixed $value, mixed $key = null)
Add after the last item in the collection
mixed
__get(mixed $name)
__get
void
__set(mixed $name, mixed $value)
__set
mixed
get(int|string|null $key = null, mixed $default = null)
Allows to recover a value or value collection.
bool
__isset(mixed $name)
__isset
void
__unset(mixed $name)
__unset
Collection
remove(string $key)
Delete an entry in the collection
string
__toString()
No description
string
toJson(int $option = 0)
No description
array
jsonSerialize()
No description
ArrayIterator
getIterator()
getIterator
bool
offsetExists(mixed $offset)
offsetExists
mixed
offsetGet(mixed $offset)
offsetGet
void
offsetSet(mixed $offset, mixed $value)
offsetSet
mixed
set(string $key, mixed $value)
Modify an entry in the collection or the addition if not
void
offsetUnset(mixed $offset)
offsetUnset