Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | */ |
||
37 | public function consumeEvent(TransformEvent $event): void |
||
38 | { |
||
39 | $this->buildProperty($event, ProductInterface::class, |
||
40 | function (ProductInterface $product, Document $document): void { |
||
41 | $channels = []; |
||
42 | |||
43 | foreach ($product->getChannels() as $channel) { |
||
44 | $channels[] = $channel->getCode(); |
||
45 | } |
||
46 | |||
47 | $document->set($this->channelsProperty, $channels); |
||
48 | } |
||
49 | ); |
||
50 | } |
||
51 | } |
||
52 |