AttributeBagInterface
extends
SessionBagInterface
in
Attributes store.
Tags
Table of Contents
- all() : array<string, mixed>
- Returns attributes.
- clear() : mixed
- Clears out data from bag.
- get() : mixed
- Returns an attribute.
- getName() : string
- Gets this bag's name.
- getStorageKey() : string
- Gets the storage key for this bag.
- has() : bool
- Checks if an attribute is defined.
- initialize() : mixed
- Initializes the Bag.
- remove() : mixed
- Removes an attribute.
- replace() : mixed
- set() : mixed
- Sets an attribute.
Methods
all()
Returns attributes.
public
all() : array<string, mixed>
Return values
array<string, mixed> —clear()
Clears out data from bag.
public
clear() : mixed
Return values
mixed —Whatever data was contained
get()
Returns an attribute.
public
get(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
-
The default value if not found
Return values
mixed —getName()
Gets this bag's name.
public
getName() : string
Return values
string —getStorageKey()
Gets the storage key for this bag.
public
getStorageKey() : string
Return values
string —has()
Checks if an attribute is defined.
public
has(string $name) : bool
Parameters
- $name : string
Return values
bool —initialize()
Initializes the Bag.
public
initialize(array<string|int, mixed> &$array) : mixed
Parameters
- $array : array<string|int, mixed>
Return values
mixed —remove()
Removes an attribute.
public
remove(string $name) : mixed
Parameters
- $name : string
Return values
mixed —The removed value or null when it does not exist
replace()
public
replace(array<string|int, mixed> $attributes) : mixed
Parameters
- $attributes : array<string|int, mixed>
Return values
mixed —set()
Sets an attribute.
public
set(string $name, mixed $value) : mixed
Parameters
- $name : string
- $value : mixed