loadQuery(ProductAccessoryRepositoryQuery::class); } public function getDefaultOptionsSearch(): array { return [ self::WITH => [], self::JOIN_WITH => ['accessoryRelation'], self::ORDER_BY => 'accessory.name ASC', self::ATTRIBUTE_ID_PRODUCER => '' ]; } public function findOneProductAccessory(Product $product, Accessory $accessory): ?ProductAccessory { return $this->createDefaultQuery() ->filterByProduct($product) ->filterByAccessory($accessory) ->findOne(); } public function findProductAccessoriesByAccessory(Accessory $accessory): array { return $this->createDefaultQuery() ->filterByAccessory($accessory) ->find(); } }