Browse Source

AbstractRepositoryQuery : ajout gestion du cache #489

develop
Guillaume Bourgeois 2 years ago
parent
commit
e6d34c0959
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      Repository/AbstractRepositoryQuery.php

+ 9
- 0
Repository/AbstractRepositoryQuery.php View File

@@ -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…
Cancel
Save