Commit 8143d397 authored by ppetermann's avatar ppetermann

fixed bug in Cache, made Array.php compliant to its/the interfaces...

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
parent 7e2498ad
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment