19 private $name =
'attributes';
36 public function __construct($storageKey =
'_sf2_attributes')
38 $this->storageKey = $storageKey;
67 return $this->storageKey;
73 public function has($name)
75 return array_key_exists($name, $this->attributes);
81 public function get($name, $default =
null)
83 return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
89 public function set($name, $value)
91 $this->attributes[$name] = $value;
107 $this->attributes = array();
109 $this->
set($key, $value);
116 public function remove($name)
119 if (array_key_exists($name, $this->attributes)) {
120 $retval = $this->attributes[$name];
121 unset($this->attributes[$name]);
130 public function clear()
133 $this->attributes = array();
145 return new \ArrayIterator($this->attributes);
153 public function count()
155 return count($this->attributes);