Version
class Version (View source)
Handles regular and retina thumbnails. e.g. Each thumbnail type has two versions of itself the regular one and the 2x one.
Properties
protected string | $directoryName | The name of the directory that contains the thumbnails. |
|
protected string | $handle | The handle of the thumbnail type version. |
|
protected string | $name | The name of the thumbnail type version. |
|
protected int|null | $width | The width of the thumbnails (or the maximum width in case of proportional sizing). |
|
protected int|null | $height | The height of the thumbnails (or the maximum height in case of proportional sizing). |
|
protected bool | $isDoubledVersion | Is this a high-DPI thumbnail type version? |
|
protected string | $sizingMode | The thumbnail sizing mode (one of the \Concrete\Core\Entity\File\Image\Thumbnail\Type\Type::RESIZE_... constants). |
Methods
Initialize the instance.
Get a thumbnail type version given its handle.
Set the name of the directory that contains the thumbnails.
Get the name of the directory that contains the thumbnails.
Set the handle of the thumbnail type version.
Get the handle of the thumbnail type version.
Set the name of the thumbnail type version.
Get the name of the thumbnail type version.
Get the display name for this thumbnail type version (localized and escaped accordingly to $format).
Set the width of the thumbnails (or the maximum width in case of proportional sizing).
Get the width of the thumbnails (or the maximum width in case of proportional sizing).
Set the height of the thumbnails (or the maximum height in case of proportional sizing).
Get the height of the thumbnails (or the maximum height in case of proportional sizing).
Set the thumbnail sizing mode.
Get the thumbnail sizing mode.
Get the display name of the thumbnail sizing mode.
Get the path to the thumbnail of a file version (relative to the to the storage location root).
Details
__construct(string $directoryName, string $handle, string $name, int|null $width, int|null $height, bool $isDoubledVersion = false, string $sizingMode = ThumbnailType::RESIZE_DEFAULT)
Initialize the instance.
static Version|null
getByHandle(string $handle)
Get a thumbnail type version given its handle.
setDirectoryName(string $directoryName)
Set the name of the directory that contains the thumbnails.
string
getDirectoryName()
Get the name of the directory that contains the thumbnails.
setHandle(string $handle)
Set the handle of the thumbnail type version.
string
getHandle()
Get the handle of the thumbnail type version.
setName(string $name)
Set the name of the thumbnail type version.
string
getName()
Get the name of the thumbnail type version.
string
getDisplayName(string $format = 'html')
Get the display name for this thumbnail type version (localized and escaped accordingly to $format).
setWidth(int|null $width)
Set the width of the thumbnails (or the maximum width in case of proportional sizing).
int|null
getWidth()
Get the width of the thumbnails (or the maximum width in case of proportional sizing).
setHeight(int|null $height)
Set the height of the thumbnails (or the maximum height in case of proportional sizing).
int|null
getHeight()
Get the height of the thumbnails (or the maximum height in case of proportional sizing).
setSizingMode(string $sizingMode)
Set the thumbnail sizing mode.
string
getSizingMode()
Get the thumbnail sizing mode.
string
getSizingModeDisplayName()
Get the display name of the thumbnail sizing mode.
string
getFilePath(Version $fv)
Get the path to the thumbnail of a file version (relative to the to the storage location root).