4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpFoundation\Session;
15 * @author Nicolas Grekas <p@tchwork.com>
19 final class SessionBagProxy implements SessionBagInterface
23 private $hasBeenStarted;
25 public function __construct(SessionBagInterface $bag, array &$data, &$hasBeenStarted)
29 $this->hasBeenStarted = &$hasBeenStarted;
33 * @return SessionBagInterface
35 public function getBag()
43 public function isEmpty()
45 return empty($this->data[$this->bag->getStorageKey()]);
51 public function getName()
53 return $this->bag->getName();
59 public function initialize(array &$array)
61 $this->hasBeenStarted = true;
62 $this->data[$this->bag->getStorageKey()] = &$array;
64 $this->bag->initialize($array);
70 public function getStorageKey()
72 return $this->bag->getStorageKey();
78 public function clear()
80 return $this->bag->clear();