class Type (View source)

Entity representing a thumbnail type.

Constants

RESIZE_PROPORTIONAL

Thumbnail sizing mode: proportional.

RESIZE_EXACT

Thumbnail sizing mode: exact dimensions.

RESIZE_DEFAULT

Default thumbnail sizing mode.

HIGHDPI_SUFFIX

Suffix for high DPI thumbnails (eg. Retina).

Properties

protected int|null $ftTypeID

The thumbnail unique identifier.

protected string $ftTypeHandle

The handle that identifies the thumbnail type.

protected string $ftTypeName

The name of the thumbnail type.

protected int|null $ftTypeWidth

The width of the thumbnails (or the maximum width in case of proportional sizing).

protected int|null $ftTypeHeight

The height of the thumbnails (or the maximum height in case of proportional sizing).

protected bool $ftTypeIsRequired

Is this thumbnail type required? If yes, it can't be deleted.

protected string $ftTypeSizingMode

The thumbnail sizing mode (one of the Type::RESIZE_... constants).

protected bool $ftUpscalingEnabled

Upscaling is enabled?

protected bool $ftLimitedToFileSets

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

protected ArrayCollection|TypeFileSet[] $ftAssociatedFileSets

Associated file sets (whose meaning depends on the value of ftLimitedToFileSets).

protected bool $ftKeepAnimations

Should we create animated thumbnails for animated images?

protected string $ftSaveAreaBackgroundColor

Background color of the Image Editor save area

Methods

__construct()

Initialize the instance.

int|null
getID()

Get the thumbnail unique identifier.

setHandle(string $ftTypeHandle)

Set the handle that identifies the thumbnail type.

string
getHandle()

Get the handle that identifies the thumbnail type.

setName(string $ftTypeName)

Set the name of the thumbnail type.

string
getName()

Get the name of the thumbnail type.

string
getDisplayName(string $format = 'html')

Get the display name for this thumbnail type (localized and escaped accordingly to $format).

setWidth(int|null $ftTypeWidth)

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 $ftTypeHeight)

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).

requireType()

Mark this this thumbnail type as required (that is, it can't be deleted).

bool
isRequired()

Is this thumbnail type required? If yes, it can't be deleted.

setSizingMode(string $ftTypeSizingMode = self::RESIZE_DEFAULT)

Set the thumbnail sizing mode.

string
getSizingMode()

Get the thumbnail sizing mode.

bool
isUpscalingEnabled()

Upscaling is enabled?

setIsUpscalingEnabled(bool $value)

Upscaling is enabled?

string
getSizingModeDisplayName()

Get the display name of the thumbnail sizing mode.

$this
setLimitedToFileSets(bool $value)

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

bool
isLimitedToFileSets()

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

ArrayCollection|TypeFileSet[]
getAssociatedFileSets()

Get the associated file sets (whose meaning depends on the value of ftLimitedToFileSets).

$this
setKeepAnimations(bool $value)

Should we create animated thumbnails for animated images?

bool
isKeepAnimations()

Should we create animated thumbnails for animated images?

$this
setSaveAreaBackgroundColor(string $color)

Background color of the Image Editor save area

string
getSaveAreaBackgroundColor()

Background color of the Image Editor save area

save()

Save this instance to the database.

delete()

Delete this instance from the database.

getBaseVersion()

Get a thumbnail type version instance representing this thumbnail type (normal-DPI).

getDoubledVersion()

Get a thumbnail type version instance representing this thumbnail type (high-DPI).

export(SimpleXMLElement $node)

No description

getVersion(bool $doubled)

No description

Details

__construct()

Initialize the instance.

int|null getID()

Get the thumbnail unique identifier.

Return Value

int|null

setHandle(string $ftTypeHandle)

Set the handle that identifies the thumbnail type.

Parameters

string $ftTypeHandle

string getHandle()

Get the handle that identifies the thumbnail type.

Return Value

string

setName(string $ftTypeName)

Set the name of the thumbnail type.

Parameters

string $ftTypeName

string getName()

Get the name of the thumbnail type.

Return Value

string

string getDisplayName(string $format = 'html')

Get the display name for this thumbnail type (localized and escaped accordingly to $format).

Parameters

string $format

= 'html' Escape the result in html format (if $format is 'html'). If $format is 'text' or any other value, the display name won't be escaped.

Return Value

string

setWidth(int|null $ftTypeWidth)

Set the width of the thumbnails (or the maximum width in case of proportional sizing).

Parameters

int|null $ftTypeWidth

int|null getWidth()

Get the width of the thumbnails (or the maximum width in case of proportional sizing).

Return Value

int|null

setHeight(int|null $ftTypeHeight)

Set the height of the thumbnails (or the maximum height in case of proportional sizing).

Parameters

int|null $ftTypeHeight

int|null getHeight()

Get the height of the thumbnails (or the maximum height in case of proportional sizing).

Return Value

int|null

requireType()

Mark this this thumbnail type as required (that is, it can't be deleted).

bool isRequired()

Is this thumbnail type required? If yes, it can't be deleted.

Return Value

bool

setSizingMode(string $ftTypeSizingMode = self::RESIZE_DEFAULT)

Set the thumbnail sizing mode.

Parameters

string $ftTypeSizingMode

one of the Type::RESIZE_... constants

string getSizingMode()

Get the thumbnail sizing mode.

Return Value

string

One of the Type::RESIZE_... constants.

bool isUpscalingEnabled()

Upscaling is enabled?

Return Value

bool

setIsUpscalingEnabled(bool $value)

Upscaling is enabled?

Parameters

bool $value

string getSizingModeDisplayName()

Get the display name of the thumbnail sizing mode.

Return Value

string

$this setLimitedToFileSets(bool $value)

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

Parameters

bool $value

Return Value

$this

bool isLimitedToFileSets()

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

Return Value

bool

ArrayCollection|TypeFileSet[] getAssociatedFileSets()

Get the associated file sets (whose meaning depends on the value of ftLimitedToFileSets).

Return Value

ArrayCollection|TypeFileSet[]

$this setKeepAnimations(bool $value)

Should we create animated thumbnails for animated images?

Parameters

bool $value

Return Value

$this

bool isKeepAnimations()

Should we create animated thumbnails for animated images?

Return Value

bool

$this setSaveAreaBackgroundColor(string $color)

Background color of the Image Editor save area

Parameters

string $color

Return Value

$this

string getSaveAreaBackgroundColor()

Background color of the Image Editor save area

Return Value

string

save()

Save this instance to the database.

delete()

Delete this instance from the database.

Version getBaseVersion()

Get a thumbnail type version instance representing this thumbnail type (normal-DPI).

Return Value

Version

Version getDoubledVersion()

Get a thumbnail type version instance representing this thumbnail type (high-DPI).

Return Value

Version

export(SimpleXMLElement $node)

No description

Parameters

SimpleXMLElement $node

private Version getVersion(bool $doubled)

No description

Parameters

bool $doubled

Return Value

Version