Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

33 lines
830B

  1. <?php
  2. namespace common\logic\Document\Invoice\Repository;
  3. use common\logic\AbstractRepository;
  4. use common\logic\Document\Invoice\Model\Invoice;
  5. class InvoiceRepository extends AbstractRepository
  6. {
  7. protected InvoiceRepositoryQuery $query;
  8. public function loadDependencies(): void
  9. {
  10. $this->loadQuery(InvoiceRepositoryQuery::class);
  11. }
  12. public function getDefaultOptionsSearch(): array
  13. {
  14. return [
  15. self::WITH => [],
  16. self::JOIN_WITH => ['user AS user_invoice', 'producer'],
  17. self::ORDER_BY => 'date ASC',
  18. self::ATTRIBUTE_ID_PRODUCER => 'invoice.id_producer'
  19. ];
  20. }
  21. public function findOneInvoiceById(int $id): ?Invoice
  22. {
  23. return $this->createDefaultQuery()
  24. ->filterById($id)
  25. ->findOne();
  26. }
  27. }