src/xPDO/xPDO.php
public function getOption($key, $options = null, $default = null, $skipEmpty = false) {
        $option = null;
        if (is_string($key) && !empty($key)) {
            $found = false;
            if (isset($options[$key])) {
                $found = true;
                $option = $options[$key];
            }

            if ((!$found || ($skipEmpty && $option === '')) && isset($this->config[$key])) {
                $found = true;
                $option = $this->config[$key];
            }

            if (!$found || ($skipEmpty && $option === ''))
                $option = $default;
        }
        else if (is_array($key)) {
            if (!is_array($option)) {
                $default = $option;
                $option = array();
            }
            foreach($key as $k) {
                $option[$k] = $this->getOption($k, $options, $default);
            }
        }
        else
            $option = $default;

        return $option;
    }
public function getOption($key, $options = null, $default = null, $skipEmpty = false) {
        $option = null;
        if (is_string($key) && !empty($key)) {
            $found = false;
            if (isset($options[$key])) {
                $found = true;
                $option = $options[$key];
            }

            if ((!$found || ($skipEmpty && $option === '')) && isset($this->config[$key])) {
                $found = true;
                $option = $this->config[$key];
            }

            if (!$found || ($skipEmpty && $option === ''))
                $option = $default;
        }
        else if (is_array($key)) {
            if (!is_array($option)) {
                $default = $option;
                $option = array();
            }
            foreach($key as $k) {
                $option[$k] = $this->getOption($k, $options, $default);
            }
        }
        else
            $option = $default;

        return $option;
    }
public function getOption ( $ key , $ options = null , $ default = null , $ skipEmpty = false ) { $ option = null ; if ( is_string ( $ key ) && ! empty ( $ key ) ) { $ found = false ; if ( isset ( $ options [ $ key ] ) ) { $ found = true ; $ option = $ options [ $ key ] ; } if ( ( ! $ found || ( $ skipEmpty && $ option === '' ) ) && isset ( $ this -> config [ $ key ] ) ) { $ found = true ; $ option = $ this -> config [ $ key ] ; } if ( ! $ found || ( $ skipEmpty && $ option === '' ) ) $ option = $ default ; } else if ( is_array ( $ key ) ) { if ( ! is_array ( $ option ) ) { $ default = $ option ; $ option = array ( ) ; } foreach ( $ key as $ k ) { $ option [ $ k ] = $ this -> getOption ( $ k , $ options , $ default ) ; } } else $ option = $ default ; return $ option ; }
Get an xPDO configuration option value by key.

@param string $key The option key.
@param array|null $options A set of options to override those from xPDO.
@param mixed|null $default An optional default value to return if no value is found.
@param bool $skipEmpty True if empty string values should be ignored.
@return mixed The configuration option value.
Get an xPDO configuration option value by key .