1
0
mirror of synced 2025-03-27 10:23:50 +03:00

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:
ppetermann 2007-09-28 15:55:56 +00:00
parent 7e2498ad35
commit 8143d39788
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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);