query = $query; } public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { $query->orderBy('id'); return $query; } public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { $query->filterIsOnlineAndOffline(); $query->filterBySection($this->section); return $query; } public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { return $query; } public function getOneLatestByType(string $documentType, $query = null) { // @TODO : à écrire } // findLastInvoice public function getOneLastInvoice($query = null) { $query = $this->createDefaultQuery($query); $query ->orderBy('createdAt', 'DESC'); return $query->findOne(); } public function getByBuyerAddress(Address $buyerAddress, $query = null) { $query = $this->createDefaultQuery($query); $query->filterByBuyerAddress($buyerAddress); return $query->find(); } }