get() public method

Returns an attribute.
public get ( string $name, mixed $default = null ) : mixed
$name string The attribute name
$default mixed The default value
return mixed
 public function get($state)
 {
     if (!in_array($state, array_keys($this->states))) {
         throw new \RunTimeException("Requested state {$state} does not exist");
     }
     return $this->session->get($this->prefix . '.' . $state, $this->states[$state]);
 }
 protected function getTranslationsFromSession()
 {
     return $this->session->get(Configuration::SESSION_PREFIX . 'import-list', array());
 }
Beispiel #3
0
 private function generateCaptchaValue()
 {
     if (!$this->keepValue || !$this->session->has($this->key)) {
         $value = '';
         $chars = str_split($this->charset);
         for ($i = 0; $i < $this->length; $i++) {
             $value .= $chars[array_rand($chars)];
         }
         $this->session->set($this->key, $value);
     } else {
         $value = $this->session->get($this->key);
     }
     return $value;
 }
 /**
  * Return the current filters to apply (from the session or the default config)
  *
  * @return array
  */
 public function getCurrentFilters()
 {
     $sessionValues = $this->session->get(Configuration::SESSION_PREFIX . 'filters', null);
     return $sessionValues !== null ? $sessionValues : $this->getDefaultFilters();
 }