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.

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

Methods

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.

string
getSizingModeDisplayName()

Get the display name of the thumbnail sizing mode.

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

Details

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.

string getSizingModeDisplayName()

Get the display name of the thumbnail sizing mode.

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