fixed bug in Cache, made Array.php compliant to its/the interfaces documentation (returning false instead of null when nothing found) and changed if statement in Hydrate to react on false, not on null too
This commit is contained in:
parent
7e2498ad35
commit
8143d39788
@ -52,7 +52,7 @@ class Doctrine_Cache_Array implements Countable, Doctrine_Cache_Interface
|
||||
if (isset($this->data[$id])) {
|
||||
return $this->data[$id];
|
||||
}
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Test if a cache is available or not (for the given id)
|
||||
|
@ -786,10 +786,10 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
|
||||
// calculate hash for dql query
|
||||
$hash = md5($dql . var_export($params, true));
|
||||
|
||||
$cached = ($this->_expireCache) ? null : $cacheDriver->fetch($hash);
|
||||
$cached = ($this->_expireCache) ? false : $cacheDriver->fetch($hash);
|
||||
|
||||
|
||||
if ($cached === null) {
|
||||
if ($cached === false) {
|
||||
// cache miss
|
||||
$stmt = $this->_execute($params);
|
||||
$array = $this->parseData2($stmt, Doctrine::HYDRATE_ARRAY);
|
||||
|
Loading…
x
Reference in New Issue
Block a user