joinCollectifData(); $this->joinIndividualData(); return $this ->andWhere('colData.status = 1 OR indivData.status = 1'); } public function filterByThematic(ArrayCollection $thematicArray): self { return $this ->andWhere('.thematic IN (:thematic)') ->setParameter(':thematic', $thematicArray); } public function filterBySubthematicName(string $subthematic): self { $this->joinSubthematic(); return $this ->andWhere('subT.name LIKE :subthematic') ->setParameter(':subthematic', '%' . $subthematic . '%'); } public function filterByDescription(string $description): self { return $this ->andWhere('.description LIKE :description') ->setParameter(':description', '%' . $description . '%'); } public function filterByTerritory(ArrayCollection $territoryArray): self { $this->joinCollectifData(); $this->joinIndividualData(); return $this ->andWhere('colData.territory IN (:territory) OR indivData.territory IN (:territory)') ->setParameter(':territory', $territoryArray); } public function joinSubthematic(): self { if (!$this->isJoinSubthematic) { $this->isJoinSubthematic = true; return $this ->leftJoin('.subthematic', 'subT'); } return $this; } public function joinCollectifData(): self { if (!$this->isJoinCollectifData) { $this->isJoinCollectifData = true; return $this ->leftJoin('.collectifData', 'colData'); } return $this; } public function joinIndividualData(): self { if (!$this->isJoinIndividualData) { $this->isJoinIndividualData = true; return $this ->leftJoin('.individualData', 'indivData'); } return $this; } }