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