mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Prevent multiples sub-queries.
This commit is contained in:
@@ -6,6 +6,7 @@ use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||
use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\ORM\Query;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
@@ -26,7 +27,10 @@ class SocialIssueApiController extends ApiController
|
||||
{
|
||||
// In order to work, this hydrator only works with
|
||||
// entities having the field "children" set up.
|
||||
return $query->getQuery()->getResult(FlatHierarchyEntityHydrator::LIST);
|
||||
return $query
|
||||
->getQuery()
|
||||
->setHint(Query::HINT_INCLUDE_META_COLUMNS, true)
|
||||
->getResult(FlatHierarchyEntityHydrator::LIST);
|
||||
}
|
||||
|
||||
protected function onPostIndexBuildQuery(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $query): ?Response
|
||||
|
Reference in New Issue
Block a user