Commit 862b7cdf authored by pookey's avatar pookey

possible improvements to Cache class

parent 8844515f
...@@ -315,12 +315,13 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite ...@@ -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 ...@@ -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;
} }
} }
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