public function getProductMainPicture(Product $product) { if ($product->getPictures()->count() > 0) { $mainPicture = $product->getPictures()->get(0)->getWebPath(); /** @var ProductPicture $picture */ foreach ($product->getPictures() as $picture) { if ($picture->getIsMain()) { $mainPicture = $picture->getWebPath(); } } return $mainPicture; } else { return $this->comingSoonPicture; } }