Elcodi\Fixtures\DataFixtures\ORM\Product\Abstracts\AbstractPurchasableData::storePurchasableImage PHP Method

storePurchasableImage() protected method

Steps necessary to store an image
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;
    }
AbstractPurchasableData