ProductImage
in package
implements
ProductImageInterface
Class ProductImage
Tags
Interfaces, Classes and Traits
- ProductImageInterface
- Interface ProductImageInterface
Table of Contents
- $altTexts : array<string|int, mixed>
- Alt texts of the image.
- $filename : string
- Filename of the product image
- $visibility : bool
- Is the product image visible?
- __construct() : mixed
- ProductImage constructor.
- getAltText() : string
- Get Alt Text
- getFilename() : string
- Get Filename
- isVisible() : bool
- Is Visible
- setAltText() : string
- Set Alt Text
- setVisible() : ProductImageInterface
- Set Visible
Properties
$altTexts
Alt texts of the image.
protected
array<string|int, mixed>
$altTexts
= []
$filename
Filename of the product image
protected
string
$filename
$visibility
Is the product image visible?
protected
bool
$visibility
= rue
Methods
__construct()
ProductImage constructor.
public
__construct(FilenameStringType $filename) : mixed
Parameters
- $filename : FilenameStringType
-
Filename of the image.
Return values
mixed —getAltText()
Get Alt Text
public
getAltText(LanguageCode $language) : string
Returns the alternative text of a product image.
Parameters
- $language : LanguageCode
-
The language code of the alt text to return.
Tags
Return values
string —The alternative text of the product image.
getFilename()
Get Filename
public
getFilename() : string
Returns the filename of the product.
Return values
string —The filename of the product.
isVisible()
Is Visible
public
isVisible() : bool
Checks if the product image is set to visible or not.
Return values
bool —Is the product image visible?
setAltText()
Set Alt Text
public
setAltText(StringType $text, LanguageCode $language) : string
Sets the alternative text of the product image.
Parameters
- $text : StringType
-
The alternative text for the product image.
- $language : LanguageCode
-
The language code of the alternative text.
Return values
string —The alternative text of the product image.
setVisible()
Set Visible
public
setVisible(BoolType $visible) : ProductImageInterface
Activates or deactivates the products image visibility.
Parameters
- $visible : BoolType
-
Should the product image be visible?
Return values
ProductImageInterface —Same instance for chained method calls.