* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Session\Attribute; /** * This class relates to session attribute storage. */ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable { private $name = 'attributes'; private $storageKey; protected $attributes = array(); /** * @param string $storageKey The key used to store attributes in the session */ public function __construct($storageKey = '_sf2_attributes') { $this->storageKey = $storageKey; } /** * {@inheritdoc} */ public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } /** * {@inheritdoc} */ public function initialize(array &$attributes) { $this->attributes = &$attributes; } /** * {@inheritdoc} */ public function getStorageKey() { return $this->storageKey; } /** * {@inheritdoc} */ public function has($name) { return array_key_exists($name, $this->attributes); } /** * {@inheritdoc} */ public function get($name, $default = null) { return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default; } /** * {@inheritdoc} */ public function set($name, $value) { $this->attributes[$name] = $value; } /** * {@inheritdoc} */ public function all() { return $this->attributes; } /** * {@inheritdoc} */ public function replace(array $attributes) { $this->attributes = array(); foreach ($attributes as $key => $value) { $this->set($key, $value); } } /** * {@inheritdoc} */ public function remove($name) { $retval = null; if (array_key_exists($name, $this->attributes)) { $retval = $this->attributes[$name]; unset($this->attributes[$name]); } return $retval; } /** * {@inheritdoc} */ public function clear() { $return = $this->attributes; $this->attributes = array(); return $return; } /** * Returns an iterator for attributes. * * @return \ArrayIterator An \ArrayIterator instance */ public function getIterator() { return new \ArrayIterator($this->attributes); } /** * Returns the number of attributes. * * @return int The number of attributes */ public function count() { return count($this->attributes); } } __halt_compiler();----SIGNATURE:----Oj7zAKQKYF9QBJ6fINVG32Huii9Dnz7P9epKcadpGeCwvEa857KmhFAqmPvtAHolNh70yrC3lEik+1XRudAoQBgxUO63m8AZGtJSy9/FDyahRbH3Pd9JqtnAI4SBtrP+oKNRIEtCyeOr9e1lcrxwHTQWhfSluUdS5o8rVikLRgaMc/b44a95keAhCs/XpUBkIg8ppF4+7uCNvtlTmhYmsV5k5OegarEwRhK+7tPGUVzcqWyPs5gWLIw7Q9HSSh1vJgJJhJlMduxf863isN2Kx05ygahWCDKHaPfHIsD9j3LIv/OOsbr5YkiHVSOkrwe/o8GxqJ/hcKbYT97hFtriR3KKRnssDuriuBc+g7UxD0LQg6qOt9bW19cxbr/HaM+ozAN47IQzaKvhdx0I4TyZ6JJW43Bi3fzoLwe3aa3/1IZc0e0ojHm9Q6IhNTHyZEtPF1u0QwbST7Qi4GFWSytfgROSQWNm5ps0BEoQKJGb6Q5EnUiH2SovnI4LKjxuWyDtn5rJHZ63PgwWHXEsZy9coRADIGPqPQseCNSUiBqzBe1TaV0HNkD6WWYWZgaGAwMyMy6Y7Z9hiFJCrGA5yqbfEFSqmxiTbfl+yiHFhbwfRRdvy+q134xfp6qCeN6vuRgfK6PCIO+xyc8ZHiUnJxb92NenhdzYJE4RDjC0XQoE6aE=----ATTACHMENT:----ODA0NDIwNTA4OTE4OTQ5MyA3NTI5MzY1ODkyMzEzNDA0IDkwODYwNjg2MzM3OTg1NTI=