Conditions | 2 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function consumeEvent(PostTransformEvent $event): void |
||
28 | { |
||
29 | $this->buildProperty( |
||
30 | $event, |
||
31 | ProductInterface::class, |
||
32 | function (ProductInterface $product, Document $document): void { |
||
33 | $channels = []; |
||
34 | |||
35 | foreach ($product->getChannels() as $channel) { |
||
36 | $channels[] = $channel->getCode(); |
||
37 | } |
||
38 | |||
39 | $document->set($this->channelsProperty, $channels); |
||
40 | } |
||
44 |