TranslateSettingName() public static method

Translates the given setting variable name into the form namespace and var name.
public static TranslateSettingName ( $p_varName ) : mixed
return mixed null If the given value is not appropriate settingVar An array containing the namespace and variable actual name
Exemplo n.º 1
0
 /**
  * Gets a setting var value from configuration.
  *
  * @param string
  *    $p_varName The name of the setting variable
  *
  * @return mixed
  *    null Var name passed is no valid
  *    mixed The value of the setting variable
  */
 public function getSetting($p_varName)
 {
     if (empty($p_varName)) {
         return null;
     }
     $settingVar = CampConfig::TranslateSettingName($p_varName);
     if (!$settingVar) {
         return array_key_exists($p_varName, $this->m_config) ? $this->m_config[$p_varName] : null;
     }
     $varname = $settingVar['varname'];
     $namespace = $settingVar['namespace'];
     if (!isset($this->m_config[$namespace]) || !is_array($this->m_config[$namespace]) || !array_key_exists($varname, $this->m_config[$namespace])) {
         return null;
     }
     return $this->m_config[$namespace][$varname];
 }