mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge remote-tracking branch 'origin/improve_location-fix-crud' into improve_location
merge...
This commit is contained in:
commit
c46065d9c5
@ -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.
|
||||
*
|
||||
|
@ -7,14 +7,14 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class LocationController extends CRUDController
|
||||
{
|
||||
public function customizeQuery(string $action, Request $request, $query): void
|
||||
protected function customizeQuery(string $action, Request $request, $query): void
|
||||
{
|
||||
//$query->where('e.availableforusers', "'TRUE'"); // not working
|
||||
$query->where('e.availableForUsers = true'); //TODO not working
|
||||
}
|
||||
|
||||
|
||||
public function createEntity(string $action, Request $request): object
|
||||
protected function createEntity(string $action, Request $request): object
|
||||
{
|
||||
$entity = parent::createEntity($action, $request);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user