loadQuery(ProductDistributionRepositoryQuery::class); } public function getDefaultOptionsSearch(): array { return [ self::WITH => ['product','distribution'], self::JOIN_WITH => [], self::ORDER_BY => '', self::ATTRIBUTE_ID_PRODUCER => '' ] ; } public function findOneProductDistribution(Distribution $distribution, Product $product): ?ProductDistribution { return $this->createDefaultQuery() ->filterByDistribution($distribution) ->filterByProduct($product) ->findOne(); } public function findProductDistributionsByDistribution(Distribution $distribution): array { return $this->createDefaultQuery() ->filterByDistribution($distribution) ->find(); } public function countProductDistributionsByDistribution(Distribution $distribution): int { return $this->createDefaultQuery() ->filterByDistribution($distribution) ->count(); } }