本文整理汇总了PHP中Doctrine\ORM\ORMException::invalidResultCacheDriver方法的典型用法代码示例。如果您正苦于以下问题:PHP ORMException::invalidResultCacheDriver方法的具体用法?PHP ORMException::invalidResultCacheDriver怎么用?PHP ORMException::invalidResultCacheDriver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\ORMException
的用法示例。
在下文中一共展示了ORMException::invalidResultCacheDriver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setResultCacheDriver
/**
* Defines a cache driver to be used for caching result sets and implictly enables caching.
*
* @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 ORMException::invalidResultCacheDriver();
}
$this->_queryCacheProfile = $this->_queryCacheProfile ? $this->_queryCacheProfile->setResultCacheDriver($resultCacheDriver) : new QueryCacheProfile(0, null, $resultCacheDriver);
return $this;
}
示例2: setResultCacheDriver
/**
* 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 ORMException::invalidResultCacheDriver();
}
$this->_resultCacheDriver = $resultCacheDriver;
if ($resultCacheDriver) {
$this->_useResultCache = true;
}
return $this;
}