Attribute\AttributeBag (Component\HttpFoundation\Session)
Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag
class AttributeBag implements AttributeBagInterface, IteratorAggregate, Countable
This class relates to session attribute storage.
Methods
__construct(string $storageKey = '_sf2_attributes') Constructor. | ||
string | getName() Gets this bag's name. | |
setName($name) | ||
initialize(array $attributes) Initializes the Bag. | ||
string | getStorageKey() Gets the storage key for this bag. | |
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. | ||
array | all() Returns attributes. | |
replace(array $attributes) Sets attributes. | ||
mixed | remove(string $name) Removes an attribute. | |
mixed | clear() Clears out data from bag. | |
ArrayIterator | getIterator() Returns an iterator for attributes. | |
int | count() Returns the number of attributes. |
Details
public __construct(string $storageKey = '_sf2_attributes')
Constructor.
public string getName()
Gets this bag's name.
public setName($name)
public initialize(array $attributes)
Initializes the Bag.
public string getStorageKey()
Gets the storage key for this bag.
public bool has(string $name)
Checks if an attribute is defined.
public mixed get(string $name, mixed $default = null)
Returns an attribute.
public set(string $name, mixed $value)
Sets an attribute.
public array all()
Returns attributes.
public replace(array $attributes)
Sets attributes.
public mixed remove(string $name)
Removes an attribute.
public mixed clear()
Clears out data from bag.
public ArrayIterator getIterator()
Returns an iterator for attributes.
public int count()
Returns the number of attributes.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.html