ProductImageContainerRepository

Implements \ProductImageContainerRepositoryInterface

Class ProductImageContainerRepository

category

System

package

Product

subpackage

Repositories

Methods

ProductImageContainerRepository constructor.

__construct(\CI_DB_query_builder $db, \LanguageProviderInterface $languageProvider) 

Arguments

$db

\CI_DB_query_builder

Database connection.

$languageProvider

\LanguageProviderInterface

Sets the alternative texts for an additional image.

_getAdditionalImagesAltText(\ProductImageInterface $additionalImage, \IdType $productId, \IdType $imageId) 
Throws
\InvalidArgumentException

on invalid arguments.

Arguments

$additionalImage

\ProductImageInterface

Additional Image.

$productId

\IdType

Product ID.

$imageId

\IdType

Image ID.

Sets alternative texts for the primary image provided.

_getPrimaryImageAltText(\ProductImageInterface $primaryImage, \IdType $productId) 
Throws
\InvalidArgumentException

on invalid arguments.

Arguments

$primaryImage

\ProductImageInterface

Product primary image.

$productId

\IdType

Product ID.

Perform database query to get additional images.

_queryAdditionalImages(\IdType $productId) : array

Arguments

$productId

\IdType

Product ID.

Response

array

Result.

Perform database query to get primary image.

_queryPrimaryImage(\IdType $productId) : array

Arguments

$productId

\IdType

Product ID.

Response

array

Result.

Saves alternative texts for additional images.

_saveAdditionalImagesAltText(\ProductImageContainerInterface $imageContainer, \IdType $productId) 
Throws
\InvalidArgumentException

on invalid arguments.

Arguments

$imageContainer

\ProductImageContainerInterface

Image container.

$productId

\IdType

Product ID.

Saves alternative texts for the primary image.

_savePrimaryImageAltText(\ProductImageContainerInterface $imageContainer, \IdType $productId) 
Throws
\InvalidArgumentException

on invalid arguments.

Arguments

$imageContainer

\ProductImageContainerInterface

Image container.

$productId

\IdType

Product ID.

Deletes a product image container based on the product ID given.

deleteByProductId(\IdType $productId) : \ProductImageContainerRepository

Arguments

$productId

\IdType

Product ID.

Response

\ProductImageContainerRepository

Same instance for method chaining.

Returns a product image container based on the product ID given.

getByProductId(\IdType $productId) : \ProductImageContainerInterface
Throws
\InvalidArgumentException

On invalid arguments.

Arguments

$productId

\IdType

Product ID.

Response

\ProductImageContainerInterface

Product image container.

Stores the product image container.

store(\IdType $productId, \ProductImageContainerInterface $imageContainer) : \ProductImageContainerRepository
Throws
\InvalidArgumentException

On invalid arguments.

Arguments

$productId

\IdType

Product ID.

$imageContainer

\ProductImageContainerInterface

Product image container.

Response

\ProductImageContainerRepository

Same instance for method chaining.

Properties

Database connection.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

Used for fetching the language data.

languageProvider : \LanguageProviderInterface