Skip to content
Browse files

Add support for result cache

  • Loading branch information...
1 parent b2c9507 commit 114332153bad378bfc7a840f8b9a107d5728f74b @bakura10 bakura10 committed Jan 7, 2013
View
28 src/DoctrineORMModule/Options/Configuration.php
@@ -35,6 +35,15 @@ class Configuration extends DBALConfiguration
protected $queryCache = 'array';
/**
+ * Set the cache key for the result cache. Cache key
+ * is assembled as "doctrine.cache.{key}" and pulled from
+ * service locator.
+ *
+ * @var string
+ */
+ protected $resultCache = 'array';
+
+ /**
* Set the driver key for the metadata driver. Driver key
* is assembeled as "doctrine.driver.{key}" and pulled from
* service locator.
@@ -230,6 +239,25 @@ public function getMetadataCache()
}
/**
+ * @param string $resultCache
+ * @return self
+ */
+ public function setResultCache($resultCache)
+ {
+ $this->resultCache = $resultCache;
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getResultCache()
+ {
+ return "doctrine.cache.{$this->resultCache}";
+ }
+
+ /**
* @param array $namedNativeQueries
* @return self
*/
View
1 src/DoctrineORMModule/Service/ConfigurationFactory.php
@@ -60,6 +60,7 @@ public function createService(ServiceLocatorInterface $serviceLocator)
$config->setMetadataCacheImpl($serviceLocator->get($options->getMetadataCache()));
$config->setQueryCacheImpl($serviceLocator->get($options->getQueryCache()));
+ $config->setResultCacheImpl($serviceLocator->get($options>getResultCache()));
$config->setMetadataDriverImpl($serviceLocator->get($options->getDriver()));
if ($namingStrategy = $options->getNamingStrategy()) {

0 comments on commit 1143321

Please sign in to comment.
Something went wrong with that request. Please try again.