| Conditions | 2 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function consumeEvent(TransformEvent $event): void |
||
| 40 | { |
||
| 41 | $this->buildProperty($event, ProductInterface::class, |
||
| 42 | function (ProductInterface $product, Document $document): void { |
||
| 43 | /** @var ProductVariantInterface $productVariant */ |
||
| 44 | $productVariant = $product->getVariants()->first(); |
||
| 45 | |||
| 46 | foreach ($productVariant->getChannelPricings() as $channelPricing) { |
||
| 47 | $propertyName = $this->channelPricingNameResolver->resolvePropertyName($channelPricing->getChannelCode()); |
||
| 48 | |||
| 49 | $document->set($propertyName, $channelPricing->getPrice()); |
||
| 50 | } |
||
| 54 |