Copied!

ImageVariation

ImageVariation.php : 16
Extends Variation

Base class for file variations (i.e. image aliases).

Properties

public $dirPath read-only

Variation.php
public string $dirPath

The path to the file (for example "var/storage/images/test/199-2-eng-GB")

public $fileName read-only

Variation.php
public string $fileName

The name of the file (for example "my_image.png")

public $fileSize read-only

Variation.php
public int $fileSize

Number of bytes for current variation

public $height read-only

ImageVariation.php
public int|null $height

The height as number of pixels (for example "256")

public $imageId read-only

ImageVariation.php
public mixed $imageId

public $info read-only

ImageVariation.php
public mixed $info

Extra information about the image, depending on the image type

public $lastModified read-only

Variation.php
public DateTime $lastModified

When the variation was last modified

public $mimeType read-only

Variation.php
public string $mimeType

The MIME type (for example "image/png")

public $name read-only

ImageVariation.php
public string $name

The name of the image alias (for example "original")

public $uri read-only

Variation.php
public string $uri

Complete path + name of image file (for example "var/storage/images/test/199-2-eng-GB/apple.png")

public $width read-only

ImageVariation.php
public int|null $width

The width as number of pixels (for example "320")

protected $dirPath

Variation.php : 49

The path to the file (for example "var/storage/images/test/199-2-eng-GB").

protected string $dirPath

protected $fileName

Variation.php : 42

The name of the file (for example "my_image.png").

protected string $fileName

protected $fileSize

Variation.php : 28

Number of bytes for current variation.

protected int $fileSize

protected $handler

ImageVariation.php : 57

Contains identifier of variation handler used to generate this particular variation.

protected string|null $handler = null

protected $height

ImageVariation.php : 30

The height as number of pixels (for example "256").

protected int|null $height

protected $imageId

ImageVariation.php : 52
protected mixed $imageId

protected $info

ImageVariation.php : 49

Contains extra information about the image, depending on the image type.

protected mixed $info

It will typically contain EXIF information from digital cameras or information about animated GIFs. If there is no information, the info will be a boolean FALSE.

Beware: This information may contain e.g. HTML, JavaScript, or PHP code, and should be treated like any other user-submitted data. Make sure it is properly escaped before use.

protected $isExternal

ImageVariation.php : 63

Indicator if variation image is external (like Fastly IO) or local (like built-in Imagine based alias).

protected bool $isExternal = false

External images won't have SPLInfo data and image dimensions as it would be redundant to fetch file.

protected $lastModified

Variation.php : 63

When the variation was last modified.

protected DateTime $lastModified

protected $mimeType

Variation.php : 35

The MIME type (for example "image/png").

protected string $mimeType

protected $name

ImageVariation.php : 37

The name of the image alias (for example "original").

protected string $name

protected $uri

Variation.php : 56

Complete path + name of image file (for example "var/storage/images/test/199-2-eng-GB/apple.png").

protected string $uri

protected $width

ImageVariation.php : 23

The width as number of pixels (for example "320").

protected int|null $width

Methods

public__construct()

ValueObject.php : 30

Construct object optionally with a set of properties.

public __construct([array<string|int, mixed> $properties = [] ])

Readonly properties values must be set using $properties as they are not writable anymore after object has been created.

Parameters

Name Type Default value Description
$properties array<string|int, mixed> [] -

protectedgetProperties()

ValueObject.php : 50

Function where list of properties are returned.

protected getProperties([array<string|int, mixed> $dynamicProperties = [] ]) : array<string|int, mixed>

Used by attributes(), override to add dynamic properties

Parameters

Name Type Default value Description
$dynamicProperties array<string|int, mixed> []

Additional dynamic properties exposed on the object

Return values

array<string|int, mixed>