loadQuery(PointSaleDistributionRepositoryQuery::class); } public function getDefaultOptionsSearch(): array { return [ self::WITH => ['distribution', 'pointSale'], self::JOIN_WITH => [], self::ORDER_BY => '', self::ATTRIBUTE_ID_PRODUCER => '' ]; } public function findOnePointSaleDistribution(Distribution $distribution, PointSale $pointSale, bool $delivery = null): ?PointSaleDistribution { $query = $this->createDefaultQuery() ->filterByDistribution($distribution) ->filterByPointSale($pointSale); if(!is_null($delivery)) { $query->filterIsDelivery($delivery); } return $query->findOne(); } public function findPointSaleDistributionsByDistribution(Distribution $distribution): array { return $this->createDefaultQuery() ->filterByDistribution($distribution) ->find(); } public function countPointSaleDistributionsByDistribution(Distribution $distribution): int { return $this->createDefaultQuery() ->filterByDistribution($distribution) ->count(); } }