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]); }
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; }
/** * @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)); }
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; }