1
0
mirror of synced 2025-03-03 19:33:22 +03:00

possible improvements to Cache class

This commit is contained in:
pookey 2007-02-09 23:39:01 +00:00
parent 8844515ffc
commit 862b7cdfaf

View File

@ -315,12 +315,13 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
$this->_driver->save(md5(serialize($query)), $data); $this->_driver->save(md5(serialize($query)), $data);
} }
} }
if ($data) if ($this->success)
{
$this->_data = $data; $this->_data = $data;
else return true;
$this->_data = array();
} }
return (bool) $data; }
return false;
} }
/** /**
* onPreFetch * onPreFetch
@ -389,12 +390,12 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
$this->_driver->save(md5(serialize(array($query, $event->getParams()))), $data); $this->_driver->save(md5(serialize(array($query, $event->getParams()))), $data);
} }
} }
if ($data) if ($this->success)
{
$this->_data = $data; $this->_data = $data;
else return true;
$this->_data = array();
} }
return (bool) $data; }
return false;
} }
} }