class Collection extends Collection (View source)

Properties

protected array $storage

The collection store

from  Collection

Methods

__construct(array $arr = [])

No description

mixed
first()

The first element of the list

array
last()

The last element of the list

bool
has(string $key, bool $strict = false)

Check existence of a key in the session collection

bool
isEmpty()

Check if a collection is empty.

mixed
get(string $key = null, mixed $default = null)

Allows to recover a value or value collection.

values()

Get the list of values of collection

keys()

Get the list of keys of collection

int
count()

Count the collection element.

collectionify(string $key)

To retrieve a value or value collection form d'instance de collection.

delete(string $key)

Delete an entry in the collection

mixed
set(string $key, mixed $value)

Modify an entry in the collection or the addition if not

each(callable $cb)

Browse all the values of the collection

merge(Collection|array $array)

Merge the collection with a painting or other collection

map(callable $cb)

Map

filter(callable $cb)

Filter

array
fill(mixed $data, int $offset)

Fill storage

reduce(callable $cb, mixed $next = null)

Reduce

string
implode($sep)

Implode

int
sum(callable $cb = null)

Sum

number
max(callable $cb = null)

Max

number
min(callable $cb = null)

Max

excepts(array $except)

Returns the key list and return an instance of Collection.

ignores(array $ignores)

Ignore the key that is given to it and return an instance of Collection.

reverse()

Reverse collection

bool
update(string|int $key, mixed $data, bool $override = false)

Update an existing value in the collection

yieldify()

Launches a generator

string
toJson(int $option = 0)

No description

int
length()

Length of the collection

mixed
shift()

Deletes the first item in the collection

mixed
pop()

Deletes the last item in the collection

array
toArray()

No description

mixed
all()

Returns the elements of the collection

mixed
push(mixed $value, int|string $key = null)

Add after the last item in the collection

mixed
__get(mixed $name)

__get

void
__set(mixed $name, mixed $value)

__set

bool
__isset(mixed $name)

__isset

void
__unset(mixed $name)

__unset

string
__toString()

No description

string
jsonSerialize()

No description

getIterator()

getIterator

bool
offsetExists(mixed $offset)

offsetExists

mixed
offsetGet(mixed $offset)

offsetGet

void
offsetSet(mixed $offset, mixed $value)

offsetSet

void
offsetUnset(mixed $offset)

offsetUnset

void
dropAll()

Allows you to delete all the selected recordings

Details

__construct(array $arr = [])

No description

Parameters

array $arr

mixed first()

The first element of the list

Return Value

mixed

array last()

The last element of the list

Return Value

array

bool has(string $key, bool $strict = false)

Check existence of a key in the session collection

Parameters

string $key
bool $strict

Return Value

bool

bool isEmpty()

Check if a collection is empty.

Return Value

bool

mixed get(string $key = null, mixed $default = null)

Allows to recover a value or value collection.

Parameters

string $key
mixed $default

Return Value

mixed

Collection values()

Get the list of values of collection

Return Value

Collection

Collection keys()

Get the list of keys of collection

Return Value

Collection

int count()

Count the collection element.

Return Value

int

Collection collectionify(string $key)

To retrieve a value or value collection form d'instance de collection.

Parameters

string $key

Return Value

Collection

Collection delete(string $key)

Delete an entry in the collection

Parameters

string $key

Return Value

Collection

mixed set(string $key, mixed $value)

Modify an entry in the collection or the addition if not

Parameters

string $key
mixed $value

Return Value

mixed

each(callable $cb)

Browse all the values of the collection

Parameters

callable $cb

Collection merge(Collection|array $array)

Merge the collection with a painting or other collection

Parameters

Collection|array $array

Return Value

Collection

Exceptions

ErrorException

Collection map(callable $cb)

Map

Parameters

callable $cb

Return Value

Collection

Collection filter(callable $cb)

Filter

Parameters

callable $cb

Return Value

Collection

array fill(mixed $data, int $offset)

Fill storage

Parameters

mixed $data
int $offset

Return Value

array

Collection reduce(callable $cb, mixed $next = null)

Reduce

Parameters

callable $cb
mixed $next

Return Value

Collection

string implode($sep)

Implode

Parameters

$sep

Return Value

string

int sum(callable $cb = null)

Sum

Parameters

callable $cb

Return Value

int

number max(callable $cb = null)

Max

Parameters

callable $cb

Return Value

number

number min(callable $cb = null)

Max

Parameters

callable $cb

Return Value

number

Collection excepts(array $except)

Returns the key list and return an instance of Collection.

Parameters

array $except

Return Value

Collection

Collection ignores(array $ignores)

Ignore the key that is given to it and return an instance of Collection.

Parameters

array $ignores

Return Value

Collection

Collection reverse()

Reverse collection

Return Value

Collection

bool update(string|int $key, mixed $data, bool $override = false)

Update an existing value in the collection

Parameters

string|int $key
mixed $data
bool $override

Return Value

bool

Generator yieldify()

Launches a generator

Return Value

Generator

string toJson(int $option = 0)

No description

Parameters

int $option

Return Value

string

int length()

Length of the collection

Return Value

int

mixed shift()

Deletes the first item in the collection

Return Value

mixed

mixed pop()

Deletes the last item in the collection

Return Value

mixed

array toArray()

No description

Return Value

array

mixed all()

Returns the elements of the collection

Return Value

mixed

mixed push(mixed $value, int|string $key = null)

Add after the last item in the collection

Parameters

mixed $value
int|string $key

Return Value

mixed

mixed __get(mixed $name)

__get

Parameters

mixed $name

Return Value

mixed

void __set(mixed $name, mixed $value)

__set

Parameters

mixed $name
mixed $value

Return Value

void

bool __isset(mixed $name)

__isset

Parameters

mixed $name

Return Value

bool

void __unset(mixed $name)

__unset

Parameters

mixed $name

Return Value

void

string __toString()

No description

Return Value

string

string jsonSerialize()

No description

Return Value

string

ArrayIterator getIterator()

getIterator

Return Value

ArrayIterator

bool offsetExists(mixed $offset)

offsetExists

Parameters

mixed $offset

Return Value

bool

mixed offsetGet(mixed $offset)

offsetGet

Parameters

mixed $offset

Return Value

mixed

void offsetSet(mixed $offset, mixed $value)

offsetSet

Parameters

mixed $offset
mixed $value

Return Value

void

void offsetUnset(mixed $offset)

offsetUnset

Parameters

mixed $offset

Return Value

void

void dropAll()

Allows you to delete all the selected recordings

Return Value

void