query = $query; } public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { $query->orderBy('id'); return $query; } public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { $query->filterIsValid(); return $query; } public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { return $query; } public function filterSearch( ?string $subthematic, ArrayCollection $territoryArray, ArrayCollection $thematicArray, $query = null ) { $query = $this->createDefaultQuery($query); if (!($thematicArray->isEmpty())) { $query->filterByThematic($thematicArray); } if (!($territoryArray->isEmpty())) { $query->filterByTerritory($territoryArray); } if (!empty($subthematic)) { $query->filterBySubthematicName($subthematic); } return $query->find(); } public function getByThematic(ThematicInterface $thematic, $query = null) { $query = $this->createDefaultQuery($query); $query->filterByThematic(new ArrayCollection([$thematic])); return $query->find(); } }