query = $query; } public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { $query->orderBy('id'); return $query; } public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { $this->addFilterBySectionOptionnal($query); $this->addFilterByMerchantViaSectionOptionnal($query); $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) { $query = $this->createDefaultQuery($query); $query->filterByUser($user); return $query->find(); } // findReductionGiftOwnedByUser public function getReductionGiftOwnedByUser(UserInterface $user, $query = null) { $query = $this->createDefaultQuery($query); $query ->filterByOwner($user) ->filterInactive(); return $query->find(); } // findReductionGiftOwnedActiveByUser public function getReductionGiftOwnedActiveByUser(UserInterface $user, $query = null) { $query = $this->createDefaultQuery($query); $query ->filterByOwner($user) ->filterActive(); return $query->find(); } }