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;
}