mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
location: filter location-type by active and availableForUsers
This commit is contained in:
parent
0439e6a821
commit
e52880bb53
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class LocationTypeApiController
|
||||||
|
*
|
||||||
|
* @package Chill\MainBundle\Controller
|
||||||
|
* @author Champs Libres
|
||||||
|
*/
|
||||||
|
class LocationTypeApiController extends ApiController
|
||||||
|
{
|
||||||
|
public function customizeQuery(string $action, Request $request, $query): void
|
||||||
|
{
|
||||||
|
$query->andWhere(
|
||||||
|
$query->expr()->andX(
|
||||||
|
$query->expr()->eq('e.availableForUsers', "'TRUE'"),
|
||||||
|
$query->expr()->eq('e.active', "'TRUE'"),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -526,6 +526,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'class' => \Chill\MainBundle\Entity\LocationType::class,
|
'class' => \Chill\MainBundle\Entity\LocationType::class,
|
||||||
|
'controller' => \Chill\MainBundle\Controller\LocationTypeApiController::class,
|
||||||
'name' => 'location_type',
|
'name' => 'location_type',
|
||||||
'base_path' => '/api/1.0/main/location-type',
|
'base_path' => '/api/1.0/main/location-type',
|
||||||
'base_role' => 'ROLE_USER',
|
'base_role' => 'ROLE_USER',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user