27 private $namespaceCharacter;
35 public function __construct($storageKey =
'_sf2_attributes', $namespaceCharacter =
'/')
37 $this->namespaceCharacter = $namespaceCharacter;
38 parent::__construct($storageKey);
44 public function has($name)
60 public function get($name, $default =
null)
76 public function set($name, $value)
86 public function remove($name)
112 $name = (strpos($name, $this->namespaceCharacter) === 0) ? substr($name, 1) : $name;
119 $parts = explode($this->namespaceCharacter, $name);
120 if (
count($parts) < 2) {
121 if (!$writeContext) {
125 $array[$parts[0]] = array();
130 unset($parts[
count($parts) - 1]);
132 foreach ($parts as $part) {
133 if (
null !== $array && !array_key_exists($part, $array)) {
134 $array[$part] = $writeContext ? array() : null;
137 $array = &$array[$part];
154 if (
false !== $pos = strrpos($name, $this->namespaceCharacter)) {
155 $name = substr($name, $pos + 1);