NamespacedAttributeBag
class NamespacedAttributeBag extends AttributeBag
This class provides structured storage of session attributes using a name spacing character in the key.
Methods
__construct(string $storageKey = '_sf2_attributes', string $namespaceCharacter = '/')
Constructor.
bool
has(string $name)
Checks if an attribute is defined.
mixed
get(string $name, mixed $default = null)
Returns an attribute.
set(string $name, mixed $value)
Sets an attribute.
mixed
remove(string $name)
Removes an attribute.
Details
at line line 35
__construct(string $storageKey = '_sf2_attributes', string $namespaceCharacter = '/')
Constructor.
in AttributeBag at line line 44
string
getName()
Gets this bag's name.
in AttributeBag at line line 49
setName($name)
in AttributeBag at line line 57
initialize(array $attributes)
Initializes the Bag.
in AttributeBag at line line 65
string
getStorageKey()
Gets the storage key for this bag.
at line line 44
bool
has(string $name)
Checks if an attribute is defined.
at line line 60
mixed
get(string $name, mixed $default = null)
Returns an attribute.
at line line 76
set(string $name, mixed $value)
Sets an attribute.
in AttributeBag at line line 97
array
all()
Returns attributes.
in AttributeBag at line line 105
replace(array $attributes)
Sets attributes.
at line line 86
mixed
remove(string $name)
Removes an attribute.
in AttributeBag at line line 130
mixed
clear()
Clears out data from bag.
in AttributeBag at line line 143
ArrayIterator
getIterator()
Returns an iterator for attributes.
in AttributeBag at line line 153
int
count()
Returns the number of attributes.