/** * Defines a cache driver to be used for caching result sets. * * @param Doctrine\Common\Cache\Cache $driver Cache driver * @return Doctrine\ORM\AbstractQuery */ public function setResultCacheDriver($resultCacheDriver = null) { if ($resultCacheDriver !== null && !$resultCacheDriver instanceof \Doctrine\Common\Cache\Cache) { throw DoctrineException::invalidResultCacheObject($resultCacheDriver); } $this->_resultCacheDriver = $resultCacheDriver; if ($resultCacheDriver) { $this->_useResultCache = true; } return $this; }