示例#1
0
 public function hasSection($section)
 {
     if (!Mesour\Components\Utils\Helpers::validateKeyName($section)) {
         throw new Mesour\InvalidArgumentException(sprintf('SessionSection name must be integer or string, %s given.', gettype($section)));
     }
     return isset($this->sections[$section]);
 }
示例#2
0
 public function set($key, $value)
 {
     if (!Mesour\Components\Utils\Helpers::validateKeyName($key)) {
         throw new Mesour\InvalidArgumentException('SessionSection name must be integer or string, ' . gettype($key) . ' given.');
     }
     $this->session->setValueForSection($this->name, $key, $value);
     return $this;
 }
示例#3
0
 /**
  * @param $section
  * @return Mesour\Components\Session\ISessionSection
  * @throws Mesour\InvalidArgumentException
  */
 public function getSection($section)
 {
     if (!Mesour\Components\Utils\Helpers::validateKeyName($section)) {
         throw new Mesour\InvalidArgumentException('SessionSection name must be integer or string, ' . gettype($section) . ' given.');
     }
     $this->sections[$section] = $section;
     return new SessionSection($this->session->getSection($section));
 }
示例#4
0
 public function set($key, $val)
 {
     if (!Mesour\Components\Utils\Helpers::validateKeyName($key)) {
         throw new Mesour\InvalidArgumentException(sprintf('Key must be integer or string, %s given.', gettype($key)));
     }
     $this->data[$key] = $val;
     return $this;
 }