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.

38 lines
900B

  1. <?php
  2. namespace domain\Product\Rotating;
  3. use domain\_\AbstractRepository;
  4. use domain\_\RepositoryQueryInterface;
  5. class RotatingRepository extends AbstractRepository
  6. {
  7. protected RotatingRepositoryQuery $query;
  8. public function loadDependencies(): void
  9. {
  10. $this->loadQuery(RotatingRepositoryQuery::class);
  11. }
  12. public function getDefaultOptionsSearch(): array
  13. {
  14. return [
  15. self::WITH => [],
  16. self::JOIN_WITH => [],
  17. self::ORDER_BY => 'rotating.name ASC',
  18. self::ATTRIBUTE_ID_PRODUCER => 'rotating.id_producer'
  19. ];
  20. }
  21. public function queryRotatings(): RepositoryQueryInterface
  22. {
  23. return $this->createDefaultQuery();
  24. }
  25. public function findOneRotatingById(int $id): ?Rotating
  26. {
  27. return $this->createDefaultQuery()
  28. ->filterById($id)
  29. ->findOne();
  30. }
  31. }