Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function transform(ProductInterface $product): ?string |
||
33 | { |
||
34 | $productThumbnails = $product->getImagesByType(self::SYLIUS_THUMBNAIL_TYPE); |
||
35 | |||
36 | if ($productThumbnails->isEmpty()) { |
||
37 | return null; |
||
38 | } |
||
39 | |||
40 | /** @var ImageInterface $productImage */ |
||
41 | $productImage = $productThumbnails->first(); |
||
42 | |||
43 | return $this->imagineFilter->getUrlOfFilteredImage($productImage->getPath(), self::SYLIUS_THUMBNAIL_FILTER); |
||
44 | } |
||
46 |