From 0f6f9b3c13c552a7c28f586b28beff5f0772867a Mon Sep 17 00:00:00 2001 From: bidi Date: Fri, 1 Mar 2024 15:19:42 +0200 Subject: [PATCH] updated query cache --- README.md | 2 +- src/Admin/src/Repository/AdminRepository.php | 2 +- src/Admin/src/Repository/AdminRoleRepository.php | 2 +- src/User/src/Repository/UserRepository.php | 4 ++-- src/User/src/Repository/UserRoleRepository.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b977ba3..74e1143 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Based on Enrico Zimuel's [Zend Expressive API - Skeleton example](https://github.com/ezimuel/zend-expressive-api), DotKernel API runs on [Laminas](https://github.com/laminas) and [Mezzio](https://github.com/mezzio) components and implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15. ![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/api) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/api/4.3.0) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/api/4.2.0) [![GitHub issues](https://img.shields.io/github/issues/dotkernel/api)](https://github.com/dotkernel/api/issues) [![GitHub forks](https://img.shields.io/github/forks/dotkernel/api)](https://github.com/dotkernel/api/network) diff --git a/src/Admin/src/Repository/AdminRepository.php b/src/Admin/src/Repository/AdminRepository.php index 617b832..0e40cfa 100644 --- a/src/Admin/src/Repository/AdminRepository.php +++ b/src/Admin/src/Repository/AdminRepository.php @@ -55,7 +55,7 @@ public function getAdmins(array $filters = []): AdminCollection ->setFirstResult($page['offset']) ->setMaxResults($page['limit']) ->getQuery() - ->useQueryCache(true); + ->setCacheable(true); return new AdminCollection($query, false); } diff --git a/src/Admin/src/Repository/AdminRoleRepository.php b/src/Admin/src/Repository/AdminRoleRepository.php index 41b4cfc..29c0a9b 100644 --- a/src/Admin/src/Repository/AdminRoleRepository.php +++ b/src/Admin/src/Repository/AdminRoleRepository.php @@ -29,7 +29,7 @@ public function getAdminRoles(array $filters = []): AdminRoleCollection ->setFirstResult($page['offset']) ->setMaxResults($page['limit']) ->getQuery() - ->useQueryCache(true); + ->setCacheable(true); return new AdminRoleCollection($query, false); } diff --git a/src/User/src/Repository/UserRepository.php b/src/User/src/Repository/UserRepository.php index d209f47..1863bf4 100644 --- a/src/User/src/Repository/UserRepository.php +++ b/src/User/src/Repository/UserRepository.php @@ -45,7 +45,7 @@ public function findByResetPasswordHash(string $hash): ?User ->andWhere('resetPasswords.hash = :hash') ->setParameter('hash', $hash) ->getQuery() - ->useQueryCache(true) + ->setCacheable(true) ->getSingleResult(); } catch (Throwable) { return null; @@ -98,7 +98,7 @@ public function getUsers(array $filters = []): UserCollection $qb->andWhere('roles.name = :role')->setParameter('role', $filters['role']); } - $qb->getQuery()->useQueryCache(true); + $qb->getQuery()->setCacheable(true); return new UserCollection($qb, false); } diff --git a/src/User/src/Repository/UserRoleRepository.php b/src/User/src/Repository/UserRoleRepository.php index fc1b4b7..f0aeb96 100644 --- a/src/User/src/Repository/UserRoleRepository.php +++ b/src/User/src/Repository/UserRoleRepository.php @@ -29,7 +29,7 @@ public function getRoles(array $params = []): UserRoleCollection ->setFirstResult($page['offset']) ->setMaxResults($page['limit']) ->getQuery() - ->useQueryCache(true); + ->setCacheable(true); return new UserRoleCollection($query, false); }