Commit bb5be9ec authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge branch 'DDC-217'

parents 230548ce 14dbe3f7
...@@ -22,6 +22,8 @@ namespace Doctrine\DBAL\Cache; ...@@ -22,6 +22,8 @@ namespace Doctrine\DBAL\Cache;
/** /**
* Query Cache Profile handles the data relevant for query caching. * Query Cache Profile handles the data relevant for query caching.
* *
* It is a value object, setter methods return NEW instances.
*
* @author Benjamin Eberlei <kontakt@beberlei.de> * @author Benjamin Eberlei <kontakt@beberlei.de>
*/ */
class QueryCacheProfile class QueryCacheProfile
...@@ -97,4 +99,31 @@ class QueryCacheProfile ...@@ -97,4 +99,31 @@ class QueryCacheProfile
} }
return array($cacheKey, $realCacheKey); return array($cacheKey, $realCacheKey);
} }
/**
* @param Cache $cache
* @return QueryCacheProfile
*/
public function setResultCacheDriver(Cache $cache)
{
return new QueryCacheProfile($this->lifetime, $this->cacheKey, $cache);
}
/**
* @param string|null $cacheKey
* @return QueryCacheProfile
*/
public function setCacheKey($cacheKey)
{
return new QueryCacheProfile($this->lifetime, $cacheKey, $this->resultCacheDriver);
}
/**
* @param int $lifetime
* @return QueryCacheProfile
*/
public function setLifetime($lifetime)
{
return new QueryCacheProfile($lifetime, $this->cacheKey, $this->resultCacheDriver);
}
} }
\ No newline at end of file
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