interface CollectionInterface (View source)

Methods

bool
has(string|int $key)

Check for existence of a key in the session collection

bool
isEmpty()

Check if a collection is empty.

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

Allows to recover a value or value collection.

mixed
add(string|int $key, mixed $data, bool $next = false)

Add an entry to the collection

mixed
remove(string|int $key)

Delete an entry in the collection

mixed
set(string $key, mixed $value)

Modify an entry in the collection

array
toArray()

Return all the entries of the collection as an array

array
toObject()

Return all entries of the collection as an object

Details

bool has(string|int $key)

Check for existence of a key in the session collection

Parameters

string|int $key

Return Value

bool

bool isEmpty()

Check if a collection is empty.

Return Value

bool

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

Allows to recover a value or value collection.

Parameters

mixed $key
mixed $default

Return Value

mixed

mixed add(string|int $key, mixed $data, bool $next = false)

Add an entry to the collection

Parameters

string|int $key
mixed $data
bool $next

Return Value

mixed

mixed remove(string|int $key)

Delete an entry in the collection

Parameters

string|int $key

Return Value

mixed

mixed set(string $key, mixed $value)

Modify an entry in the collection

Parameters

string $key
mixed $value

Return Value

mixed

array toArray()

Return all the entries of the collection as an array

Return Value

array

array toObject()

Return all entries of the collection as an object

Return Value

array