Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

InvoiceRepository.php 782B

12345678910111213141516171819202122232425262728293031
  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->query = $this->loadService(InvoiceRepositoryQuery::class);
  11. }
  12. public function getDefaultOptionsSearch(): array
  13. {
  14. return [
  15. 'with' => [],
  16. 'join_with' => ['user AS user_invoice', 'producer'],
  17. 'orderby' => 'date ASC',
  18. 'attribute_id_producer' => 'invoice.id_producer'
  19. ];
  20. }
  21. public function findOneInvoiceById(int $id): ?Invoice
  22. {
  23. return Invoice::searchOne(['id' => $id]);
  24. }
  25. }