query = $query; } public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { $query->orderBy('id'); return $query; } public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { if($this->section) { $query->filterBySection($this->section); } $query->filterIsOnlineAndOffline(); return $query; } public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { return $query; } // findReductionCreditsByUser public function getByTypeAndUser(string $type, UserInterface $user, $query = null) { $query = $this->createDefaultQuery($query); $query ->filterByType($type) ->filterByUser($user); return $query->find(); } // findReductionGiftToUseByUser public function getReductionGiftToUseByUser(UserInterface $user, $query = null) { /// @TODO : à écrire $query = $this->createDefaultQuery($query); $query->filterByUser($user); return $query->find(); } // findReductionGiftOwnedByUser public function getReductionGiftOwnedByUser(UserInterface $user, $query = null) { /// @TODO : à écrire $query = $this->createDefaultQuery($query); $query->filterByUser($user); return $query->find(); } // findReductionGiftOwnedActiveByUser public function getReductionGiftOwnedActiveByUser(UserInterface $user, $query = null) { /// @TODO : à écrire $query = $this->createDefaultQuery($query); $query->filterByUser($user); return $query->find(); } }