瀏覽代碼

AbstractRepositoryQuery : ajout gestion du cache #489

develop
Guillaume Bourgeois 2 年之前
父節點
當前提交
e6d34c0959
共有 1 個檔案被更改,包括 9 行新增0 行删除
  1. +9
    -0
      Repository/AbstractRepositoryQuery.php

+ 9
- 0
Repository/AbstractRepositoryQuery.php 查看文件

@@ -251,5 +251,14 @@ abstract class AbstractRepositoryQuery implements RepositoryQueryInterface
{
return $this->andWhere('.position < :position')->setParameter('position', $position);
}

public function enableCache($lifetime, $idCache)
{
return $this->getQueryBuilder()->getQuery()
->useQueryCache(true)
->setQueryCacheLifetime($lifetime)
->enableResultCache($lifetime, $idCache);
}

}


Loading…
取消
儲存