Updates from lnApp

This commit is contained in:
Deon George
2011-07-14 08:59:32 +10:00
parent 5c9750e957
commit 46c3b9a075
31 changed files with 991 additions and 434 deletions

View File

@@ -214,7 +214,7 @@ class Kohana_Database_Query {
// Set the cache key based on the database instance name and SQL
$cache_key = 'Database::query("'.$db.'", "'.$sql.'")';
if ($result = Kohana::cache($cache_key, NULL, $this->_lifetime))
if (! is_null($result = Kohana::cache($cache_key, NULL, $this->_lifetime)))
{
// Return a cached result
return new Database_Result_Cached($result, $sql, $this->_as_object, $this->_object_params);

View File

@@ -110,6 +110,10 @@ abstract class Kohana_Database_Query_Builder extends Database_Query {
// Quote the min and max value
$value = $min.' AND '.$max;
}
elseif ($op === 'IN' AND is_array($value))
{
$value = $db->quote($value);
}
elseif ((is_string($value) AND array_key_exists($value, $this->_parameters)) === FALSE)
{
// Quote the value, it is not a parameter