setMain example

return $image;
    }

    /** * Helper function to map the media data into a product image * * @return Image */
    public function updateArticleImageWithMedia(ProductModel $article, Image $image, MediaModel $media)
    {
        $image->setMain(2);
        $image->setMedia($media);
        $image->setArticle($article);
        $image->setPath($media->getName());
        $image->setExtension($media->getExtension());
        $image->setDescription($media->getDescription());

        return $image;
    }

    /** * @param int $articleId * @param array $translations * * @throws CustomValidationException */
/** * Helper function which creates a variant image for the passed product image. * * @return Image */
    public function createVariantImage(Image $articleImage, Detail $variant)
    {
        $variantImage = new Image();
        $variantImage->setParent($articleImage);
        $variantImage->setArticleDetail($variant);
        $variantImage->setPosition($articleImage->getPosition());
        $variantImage->setMain($articleImage->getMain());
        $variantImage->setExtension($articleImage->getExtension());

        return $variantImage;
    }

    /** * @param Collection|array $options * * @return Mapping */
    public function createImageMappingForOptions($options, Image $image)
    {
Home | Imprint | This part of the site doesn't use cookies.