| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function buildProperty(TransformEvent $event): void |
||
| 37 | { |
||
| 38 | /** @var ProductInterface $product */ |
||
| 39 | $product = $event->getObject(); |
||
| 40 | |||
| 41 | if (!$product instanceof ProductInterface) { |
||
|
|
|||
| 42 | return; |
||
| 43 | } |
||
| 44 | |||
| 45 | $document = $event->getDocument(); |
||
| 46 | $createdAt = $product->getCreatedAt()->format('U'); |
||
| 47 | |||
| 48 | $document->set($this->createdAtProperty, $createdAt); |
||
| 49 | } |
||
| 51 |