選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

InvoiceRepository.php 770B

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