interface CollectionInterface (View source)

Methods

bool
has(string $key)

Check for existence of a key in the session collection

bool
isEmpty()

Check if a collection is empty.

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

Allows to recover a value or value collection.

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

Add an entry to the collection

remove(string $key)

Delete an entry in the collection

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 $key)

Check for existence of a key in the session collection

Parameters

string $key

Return Value

bool

bool isEmpty()

Check if a collection is empty.

Return Value

bool

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

Allows to recover a value or value collection.

Parameters

string $key
mixed $default

Return Value

mixed

CollectionInterface add(string $key, $data, bool $next = false)

Add an entry to the collection

Parameters

string $key
$data
bool $next

Return Value

CollectionInterface

CollectionInterface remove(string $key)

Delete an entry in the collection

Parameters

string $key

Return Value

CollectionInterface

CollectionInterface set(string $key, mixed $value)

Modify an entry in the collection

Parameters

string $key
mixed $value

Return Value

CollectionInterface

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