44 private $attributeName;
58 $this->attributeName = $attributes->getName();
61 $flashes = $flashes ?:
new FlashBag();
62 $this->flashName = $flashes->getName();
69 public function start()
71 return $this->storage->start();
77 public function has($name)
79 return $this->getAttributeBag()->has($name);
85 public function get($name, $default =
null)
87 return $this->getAttributeBag()->get($name, $default);
93 public function set($name, $value)
95 $this->getAttributeBag()->set($name, $value);
101 public function all()
103 return $this->getAttributeBag()->all();
109 public function replace(array $attributes)
111 $this->getAttributeBag()->replace($attributes);
117 public function remove($name)
119 return $this->getAttributeBag()->remove($name);
125 public function clear()
127 $this->storage->getBag($this->attributeName)->clear();
135 return $this->storage->isStarted();
145 return new \ArrayIterator($this->getAttributeBag()->
all());
153 public function count()
155 return count($this->getAttributeBag()->
all());
163 $this->storage->clear();
165 return $this->
migrate(
true, $lifetime);
171 public function migrate($destroy =
false, $lifetime =
null)
173 return $this->storage->regenerate($destroy, $lifetime);
179 public function save()
181 $this->storage->save();
187 public function getId()
189 return $this->storage->getId();
195 public function setId($id)
197 $this->storage->setId($id);
205 return $this->storage->getName();
213 $this->storage->setName($name);
221 return $this->storage->getMetadataBag();
229 $this->storage->registerBag($bag);
235 public function getBag($name)
237 return $this->storage->getBag($name);
247 return $this->
getBag($this->flashName);
257 private function getAttributeBag()
259 return $this->storage->getBag($this->attributeName);