ProductImageContainerRepository
in package
implements
ProductImageContainerRepositoryInterface
Class ProductImageContainerRepository
Tags
Interfaces, Classes and Traits
- ProductImageContainerRepositoryInterface
- Interface ProductImageContainerRepositoryInterface
Table of Contents
- $db : CI_DB_query_builder
- Database connection.
- $languageProvider : LanguageProviderInterface
- Used for fetching the language data.
- __construct() : mixed
- ProductImageContainerRepository constructor.
- deleteByProductId() : ProductImageContainerRepository
- Deletes a product image container based on the product ID given.
- getByProductId() : ProductImageContainerInterface
- Returns a product image container based on the product ID given.
- store() : ProductImageContainerRepository
- Stores the product image container.
- _getAdditionalImagesAltText() : mixed
- Sets the alternative texts for an additional image.
- _getPrimaryImageAltText() : mixed
- Sets alternative texts for the primary image provided.
- _queryAdditionalImages() : array<string|int, mixed>
- Perform database query to get additional images.
- _queryPrimaryImage() : array<string|int, mixed>
- Perform database query to get primary image.
- _saveAdditionalImagesAltText() : mixed
- Saves alternative texts for additional images.
- _savePrimaryImageAltText() : mixed
- Saves alternative texts for the primary image.
Properties
$db
Database connection.
protected
CI_DB_query_builder
$db
$languageProvider
Used for fetching the language data.
protected
LanguageProviderInterface
$languageProvider
Methods
__construct()
ProductImageContainerRepository constructor.
public
__construct(CI_DB_query_builder $db, LanguageProviderInterface $languageProvider) : mixed
Parameters
- $db : CI_DB_query_builder
-
Database connection.
- $languageProvider : LanguageProviderInterface
Return values
mixed —deleteByProductId()
Deletes a product image container based on the product ID given.
public
deleteByProductId(IdType $productId) : ProductImageContainerRepository
Parameters
- $productId : IdType
-
Product ID.
Return values
ProductImageContainerRepository —Same instance for method chaining.
getByProductId()
Returns a product image container based on the product ID given.
public
getByProductId(IdType $productId) : ProductImageContainerInterface
Parameters
- $productId : IdType
-
Product ID.
Tags
Return values
ProductImageContainerInterface —Product image container.
store()
Stores the product image container.
public
store(IdType $productId, ProductImageContainerInterface $imageContainer) : ProductImageContainerRepository
Parameters
- $productId : IdType
-
Product ID.
- $imageContainer : ProductImageContainerInterface
-
Product image container.
Tags
Return values
ProductImageContainerRepository —Same instance for method chaining.
_getAdditionalImagesAltText()
Sets the alternative texts for an additional image.
protected
_getAdditionalImagesAltText(ProductImageInterface $additionalImage, IdType $productId, IdType $imageId) : mixed
Parameters
- $additionalImage : ProductImageInterface
-
Additional Image.
- $productId : IdType
-
Product ID.
- $imageId : IdType
-
Image ID.
Tags
Return values
mixed —_getPrimaryImageAltText()
Sets alternative texts for the primary image provided.
protected
_getPrimaryImageAltText(ProductImageInterface $primaryImage, IdType $productId) : mixed
Parameters
- $primaryImage : ProductImageInterface
-
Product primary image.
- $productId : IdType
-
Product ID.
Tags
Return values
mixed —_queryAdditionalImages()
Perform database query to get additional images.
protected
_queryAdditionalImages(IdType $productId) : array<string|int, mixed>
Parameters
- $productId : IdType
-
Product ID.
Return values
array<string|int, mixed> —Result.
_queryPrimaryImage()
Perform database query to get primary image.
protected
_queryPrimaryImage(IdType $productId) : array<string|int, mixed>
Parameters
- $productId : IdType
-
Product ID.
Return values
array<string|int, mixed> —Result.
_saveAdditionalImagesAltText()
Saves alternative texts for additional images.
protected
_saveAdditionalImagesAltText(ProductImageContainerInterface $imageContainer, IdType $productId) : mixed
Parameters
- $imageContainer : ProductImageContainerInterface
-
Image container.
- $productId : IdType
-
Product ID.
Tags
Return values
mixed —_savePrimaryImageAltText()
Saves alternative texts for the primary image.
protected
_savePrimaryImageAltText(ProductImageContainerInterface $imageContainer, IdType $productId) : mixed
Parameters
- $imageContainer : ProductImageContainerInterface
-
Image container.
- $productId : IdType
-
Product ID.