ProductImage

Implements \ProductImageInterface

Class ProductImage

category

System

package

Product

subpackage

Entities

Methods

ProductImage constructor.

__construct(\FilenameStringType $filename) 

Arguments

$filename

\FilenameStringType

Filename of the image.

Get Alt Text

getAltText(\LanguageCode $language) : string

Returns the alternative text of a product image.

Throws
\InvalidArgumentException

if the language code is not valid.

Arguments

$language

\LanguageCode

The language code of the alt text to return.

Response

string

The alternative text of the product image.

Get Filename

getFilename() : string

Returns the filename of the product.

Response

string

The filename of the product.

Is Visible

isVisible() : boolean

Checks if the product image is set to visible or not.

Response

boolean

Is the product image visible?

Set Alt Text

setAltText(\StringType $text, \LanguageCode $language) : string

Sets the alternative text of the product image.

Arguments

$text

\StringType

The alternative text for the product image.

$language

\LanguageCode

The language code of the alternative text.

Response

string

The alternative text of the product image.

Set Visible

setVisible(\BoolType $visible) : \ProductImageInterface

Activates or deactivates the products image visibility.

Arguments

$visible

\BoolType

Should the product image be visible?

Response

\ProductImageInterface

Same instance for chained method calls.

Properties

Filename of the product image

filename : string
var

Type(s)

string

Alt texts of the image.

altTexts : array
var

Type(s)

array

Is the product image visible?

visibility : boolean
var

Type(s)

boolean