Phergie_Plugin_Abstract::getConfig PHP Метод

getConfig() публичный Метод

Returns the current configuration handler or the value of a single setting from it.
public getConfig ( string $name = null, mixed $default = null ) : Phergie_Config | mixed
$name string Optional name of a setting for which the value should be returned instead of the entire configuration handler
$default mixed Optional default value to return if no value is set for the setting indicated by $name
Результат Phergie_Config | mixed Configuration handler or value of the setting specified by $name
    public function getConfig($name = null, $default = null)
    {
        if (empty($this->config)) {
            throw new Phergie_Plugin_Exception('Configuration handler cannot be accessed before one is set', Phergie_Plugin_Exception::ERR_NO_CONFIG_HANDLER);
        }
        if (!is_null($name)) {
            if (!isset($this->config[$name])) {
                return $default;
            }
            return $this->config[$name];
        }
        return $this->config;
    }