protected storePurchasableImage ( Elcodi\Component\Product\Entity\Interfaces\PurchasableInterface $purchasable, string $imageName ) | ||
$purchasable | Elcodi\Component\Product\Entity\Interfaces\PurchasableInterface | Purchasable |
$imageName | string | Image name |
protected function storePurchasableImage(PurchasableInterface $purchasable, $imageName)
{
$imagePath = realpath(__DIR__ . '/../images/' . $imageName);
$image = $this->storeImage($imagePath);
$purchasable->addImage($image);
$purchasable->setPrincipalImage($image);
return $this;
}