| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | */ |
||
| 39 | public function consumeEvent(TransformEvent $event): void |
||
| 40 | { |
||
| 41 | $this->buildProperty($event, ProductInterface::class, |
||
| 42 | function (ProductInterface $product, Document $document): void { |
||
| 43 | /** @var ProductTranslationInterface $productTranslation */ |
||
| 44 | foreach ($product->getTranslations() as $productTranslation) { |
||
| 45 | $propertyName = $this->productNameNameResolver->resolvePropertyName($productTranslation->getLocale()); |
||
| 46 | |||
| 47 | $document->set($propertyName, $productTranslation->getName()); |
||
| 48 | } |
||
| 49 | } |
||
| 50 | ); |
||
| 51 | } |
||
| 52 | } |
||
| 53 |