|
- <?php
-
- namespace domain\Document\Quotation;
-
- use domain\_\AbstractRepository;
-
- class QuotationRepository extends AbstractRepository
- {
- protected QuotationRepositoryQuery $query;
-
- public function loadDependencies(): void
- {
- $this->loadQuery(QuotationRepositoryQuery::class);
- }
-
- public function getDefaultOptionsSearch(): array
- {
- return [
- self::WITH => [],
- self::JOIN_WITH => ['user AS user_quotation', 'producer'],
- self::ORDER_BY => 'date ASC',
- self::ATTRIBUTE_ID_PRODUCER => 'quotation.id_producer'
- ];
- }
-
- public function findOneQuotationById(int $id): ?Quotation
- {
- return $this->createDefaultQuery()
- ->filterById($id)
- ->findOne();
- }
- }
|