From 693a2889bcf5a736cca49ef92e4875ade3547bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 22 Oct 2021 17:24:05 +0200 Subject: [PATCH] fix query customization in crud controller --- .../ChillMainBundle/CRUD/Controller/CRUDController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php index 9c657ae46..d3112fd97 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php @@ -342,13 +342,19 @@ class CRUDController extends AbstractController */ protected function buildQueryEntities(string $action, Request $request) { - return $this->getDoctrine()->getManager() + $query = $this->getDoctrine()->getManager() ->createQueryBuilder() ->select('e') ->from($this->getEntityClass(), 'e') ; + + $this->customizeQuery($action, $request, $query); + + return $query; } + protected function customizeQuery(string $action, Request $request, $query): void {} + /** * Query the entity. *