MetaModels\Filter\Setting\CustomSql::getValueFromSource PHP Method

getValueFromSource() private method

Retrieve the value with the given name from the source with the given name.
private getValueFromSource ( string $source, string $valueName, array $arguments ) : mixed
$source string The source to retrieve the value from. Valid values are: ('get', 'post', 'cookie', 'session', 'filter' or 'container').
$valueName string The name of the value in the source to retrieve.
$arguments array The arguments of the parameter.
return mixed
    private function getValueFromSource($source, $valueName, $arguments)
    {
        switch (strtolower($source)) {
            case 'get':
                return \Input::get($valueName);
            case 'post':
                return \Input::post($valueName);
            case 'cookie':
                return \Input::cookie($valueName);
            case 'session':
                return \Session::getInstance()->get($valueName);
            case 'filter':
                if (is_array($this->filterParameters)) {
                    if (array_key_exists($valueName, $this->filterParameters)) {
                        return $this->filterParameters[$valueName];
                    }
                    return null;
                }
                break;
            case 'container':
                return $this->getValueFromServiceContainer($valueName, $arguments);
            default:
        }
        // Unknown sources always resort to null.
        return null;
    }