Customize query to return ordered active gender entities

This commit is contained in:
2024-10-21 16:18:50 +02:00
parent 8b1d73356f
commit 30ebd00693
2 changed files with 18 additions and 0 deletions

View File

@@ -17,6 +17,14 @@ use Symfony\Component\HttpFoundation\Request;
class GenderApiController extends ApiController
{
protected function customizeQuery(string $action, Request $request, $query): void
{
$query
->andWhere(
$query->expr()->eq('e.active', "'TRUE'")
);
}
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format)
{
return $query->addOrderBy('e.order', 'ASC');