You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
839B

  1. <?php
  2. namespace common\logic\Document\DeliveryNote\Repository;
  3. use common\logic\AbstractRepository;
  4. use common\logic\Document\DeliveryNote\Model\DeliveryNote;
  5. class DeliveryNoteRepository extends AbstractRepository
  6. {
  7. protected DeliveryNoteRepositoryQuery $query;
  8. public function loadDependencies(): void
  9. {
  10. $this->query = $this->loadService(DeliveryNoteRepositoryQuery::class);
  11. }
  12. public function getDefaultOptionsSearch(): array
  13. {
  14. return [
  15. 'with' => [],
  16. 'join_with' => ['user AS user_delivery_note', 'producer'],
  17. 'orderby' => 'date ASC',
  18. 'attribute_id_producer' => 'delivery_note.id_producer'
  19. ];
  20. }
  21. public function findOneDeliveryNoteById(int $id): ?DeliveryNote
  22. {
  23. return DeliveryNote::searchOne(['id' => $id]);
  24. }
  25. }