Пример #1
0
 /**
  * Gets specified setting
  *
  * @param   string      $name     The name of the setting
  * @param   bool        $useCache optional Whether it should use cache
  * @return  string|null Returns the value on success or NULL if it does not exist.
  */
 public function getSetting($name, $useCache = true)
 {
     if (!$useCache || $this->_settings === null || !array_key_exists($name, $this->_settings)) {
         if ($this->_settings === null) {
             $this->fetchSettings();
         } else {
             $this->_settings[$name] = UserSetting::getValue([$this->id, $name]);
         }
     }
     return isset($this->_settings[$name]) ? $this->_settings[$name] : null;
 }