Hoa central
Flash.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Session;
38 
48 class Flash extends Session
49 {
55  const EVENT_CHANNEL = 'hoa://Event/Session/Flash/';
56 
62  const TOP_NAMESPACE = '__Hoa_Flash__';
63 
64 
65 
74  public function __construct($namespace = '_defaultFlash')
75  {
76  parent::__construct($namespace, parent::NO_CACHE);
77 
78  return;
79  }
80 
87  public function offsetGet($offset)
88  {
89  $out = parent::offsetGet($offset);
90  $this->offsetUnset($offset);
91 
92  return $out;
93  }
94 
101  public function offsetUnset($offset)
102  {
103  parent::offsetUnset($offset);
104 
105  if (true === $this->isEmpty()) {
106  $this->delete();
107  }
108 
109  return;
110  }
111 
117  public function getIterator()
118  {
119  $out = parent::getIterator();
120  $this->delete();
121 
122  return $out;
123  }
124 }
offsetGet($offset)
Definition: Flash.php:87
__construct($namespace= '_defaultFlash')
Definition: Flash.php:74
const EVENT_CHANNEL
Definition: Flash.php:55
const TOP_NAMESPACE
Definition: Flash.php:62
offsetUnset($offset)
Definition: Flash.php:101