class SessionBagProxy
@author Nicolas Grekas <p@tchwork.com>
@internal
Hierarchy
- class \Symfony\Component\HttpFoundation\Session\SessionBagProxy implements \Symfony\Component\HttpFoundation\Session\SessionBagInterface
Expanded class hierarchy of SessionBagProxy
File
-
vendor/
symfony/ http-foundation/ Session/ SessionBagProxy.php, line 19
Namespace
Symfony\Component\HttpFoundation\SessionView source
final class SessionBagProxy implements SessionBagInterface {
private array $data;
private ?int $usageIndex;
private ?\Closure $usageReporter;
public function __construct(SessionBagInterface $bag, array &$data, ?int &$usageIndex, ?callable $usageReporter) {
$this->bag = $bag;
$this->data =& $data;
$this->usageIndex =& $usageIndex;
$this->usageReporter = null === $usageReporter ? null : $usageReporter(...);
}
public function getBag() : SessionBagInterface {
++$this->usageIndex;
if ($this->usageReporter && 0 <= $this->usageIndex) {
($this->usageReporter)();
}
return $this->bag;
}
public function isEmpty() : bool {
if (!isset($this->data[$this->bag
->getStorageKey()])) {
return true;
}
++$this->usageIndex;
if ($this->usageReporter && 0 <= $this->usageIndex) {
($this->usageReporter)();
}
return empty($this->data[$this->bag
->getStorageKey()]);
}
public function getName() : string {
return $this->bag
->getName();
}
public function initialize(array &$array) : void {
++$this->usageIndex;
if ($this->usageReporter && 0 <= $this->usageIndex) {
($this->usageReporter)();
}
$this->data[$this->bag
->getStorageKey()] =& $array;
$this->bag
->initialize($array);
}
public function getStorageKey() : string {
return $this->bag
->getStorageKey();
}
public function clear() : mixed {
return $this->bag
->clear();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
SessionBagProxy::$data | private | property | ||
SessionBagProxy::$usageIndex | private | property | ||
SessionBagProxy::$usageReporter | private | property | ||
SessionBagProxy::clear | public | function | Clears out data from bag. | Overrides SessionBagInterface::clear |
SessionBagProxy::getBag | public | function | ||
SessionBagProxy::getName | public | function | Gets this bag's name. | Overrides SessionBagInterface::getName |
SessionBagProxy::getStorageKey | public | function | Gets the storage key for this bag. | Overrides SessionBagInterface::getStorageKey |
SessionBagProxy::initialize | public | function | Initializes the Bag. | Overrides SessionBagInterface::initialize |
SessionBagProxy::isEmpty | public | function | ||
SessionBagProxy::__construct | public | function |