Gdn_SQLDriver::applyParameters PHP Method

applyParameters() public method

public applyParameters ( $Sql, null $Parameters = null ) : mixed
$Sql
$Parameters null
return mixed
    public function applyParameters($Sql, $Parameters = null)
    {
        if (!is_array($Parameters)) {
            $Parameters = $this->_NamedParameters;
        }
        // Sort the parameters so that we don't have clashes.
        krsort($Parameters);
        foreach ($Parameters as $Key => $Value) {
            if (is_null($Value)) {
                $QValue = 'null';
            } else {
                $QValue = $this->Database->connection()->quote($Value);
            }
            $Sql = str_replace($Key, $QValue, $Sql);
        }
        return $Sql;
    }