ProductImageContainer
in package
implements
ProductImageContainerInterface
Class ProductImageContainer
Tags
Interfaces, Classes and Traits
- ProductImageContainerInterface
- Interface ProductImageContainerInterface
Table of Contents
- $additionalImages : array<string|int, mixed>
- Additional image associative array.
- $primaryImage : ProductImage
- Primary image.
- __construct() : mixed
- ProductImageContainer constructor.
- addAdditional() : ProductImageContainer
- Adds an additional image to the additional images array.
- delete() : ProductImageContainer
- Deletes an image from the additional images array.
- getAdditionals() : ProductImageCollection
- Returns the array of additional images as a collection.
- getPrimary() : ProductImageInterface
- Returns the product primary image from container.
- replaceAdditional() : ProductImageContainer
- Replaces an additional product image in the container.
- setPrimary() : ProductImageContainer
- Sets the primary image of the image container.
Properties
$additionalImages
Additional image associative array.
protected
array<string|int, mixed>
$additionalImages
$primaryImage
Primary image.
protected
ProductImage
$primaryImage
Methods
__construct()
ProductImageContainer constructor.
public
__construct() : mixed
Return values
mixed —addAdditional()
Adds an additional image to the additional images array.
public
addAdditional(ProductImageInterface $image) : ProductImageContainer
Parameters
- $image : ProductImageInterface
-
Additional product image to set in the container.
Tags
Return values
ProductImageContainer —Same instance for chained method calls.
delete()
Deletes an image from the additional images array.
public
delete(FilenameStringType $imageFile) : ProductImageContainer
Parameters
- $imageFile : FilenameStringType
-
Image filename.
Return values
ProductImageContainer —Same instance for chained method calls.
getAdditionals()
Returns the array of additional images as a collection.
public
getAdditionals() : ProductImageCollection
Return values
ProductImageCollection —The requested additional images from container.
getPrimary()
Returns the product primary image from container.
public
getPrimary() : ProductImageInterface
Return values
ProductImageInterface —The requested primary product image from the image container.
replaceAdditional()
Replaces an additional product image in the container.
public
replaceAdditional(FilenameStringType $imageFile, ProductImageInterface $image) : ProductImageContainer
Parameters
- $imageFile : FilenameStringType
-
Image file name.
- $image : ProductImageInterface
-
Image to place.
Return values
ProductImageContainer —Same instance for chained method calls.
setPrimary()
Sets the primary image of the image container.
public
setPrimary(ProductImageInterface $image) : ProductImageContainer
Parameters
- $image : ProductImageInterface
-
Primary product image to set.
Return values
ProductImageContainer —Same instance for chained method calls.