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

Methods

__construct()

No description

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

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

getVersion(bool $doubled)

No description

Details

__construct()

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[]

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

private Version getVersion(bool $doubled)

Parameters

bool $doubled

Return Value

Version