class Type (View source)

Constants

T_IMAGE

Image file type.

T_VIDEO

Video file type.

T_TEXT

Text file type.

T_AUDIO

Audio file type.

T_DOCUMENT

Document file type.

T_APPLICATION

Application file type.

T_UNKNOWN

Other/unknown file type.

Properties

string $pkgHandle Handle of the owner package (empty string if not available).
int $type Generic category type (one of the \Concrete\Core\File\Type\Type::T_.
string $name Name (empty string if generic type).
string $extension Single file extension.
string $customImporter Handle of the custom importer (empty string if not available).
string $editor Handle of the editor (empty string if not available).
string $view Handle of the inline viewer (empty string if not available).

Methods

string
getPackageHandle()

Get the handle of the owner package (empty string if not available).

setPackageHandle(string $value)

Set the handle of the owner package (empty string if not available).

int
getGenericType()

Get the generic category type (one of the \Concrete\Core\File\Type\Type::T_.

setGenericType(int $value)

Set the generic category type (one of the \Concrete\Core\File\Type\Type::T_.

string
getGenericDisplayType()

Get the name of the generic category type.

string
getName()

Get the name (empty string if generic type).

setName(string $value)

Set the name (empty string if generic type).

string
getDisplayName()

Get the display name (localized).

string
getExtension()

Get the single file extension.

setExtension(string $value)

Set the single file extension.

string
getCustomImporter()

Get the handle of the custom importer (empty string if not available).

setCustomImporter(string $value)

Set the handle of the custom importer (empty string if not available).

string
getEditor()

Get the handle of the editor (empty string if not available).

setEditor(string $value)

Set the handle of the editor (empty string if not available).

string
getView()

Get the handle of the inline viewer (empty string if not available).

setView(string $value)

Set the handle of the inline viewer (empty string if not available).

Inspector|null
getCustomInspector()

Get the inspector for this file type (if available).

static string[]
getUsedExtensionList()

Get the list of all the file extensions used by approved file versions.

static int[]
getUsedTypeList()

Get the list of all the file types used by approved file versions.

static int[]
getTypeList()

Get the list of all the available type IDs.

string
getThumbnail(bool $fullImageTag = true)

Returns a thumbnail for this type of file.

bool|null
supportsThumbnails()

Does the file type support thumbnails.

bool|null
isSVG()

Is the file type an SVG.

static string|null
getGenericTypeText(int $type)

Get the name of a generic file type.

Details

string getPackageHandle()

Get the handle of the owner package (empty string if not available).

Return Value

string

Type setPackageHandle(string $value)

Set the handle of the owner package (empty string if not available).

Parameters

string $value

Return Value

Type Returns the class instance itself for method chaining

int getGenericType()

Get the generic category type (one of the \Concrete\Core\File\Type\Type::T_.

.. constants).

Return Value

int

Type setGenericType(int $value)

Set the generic category type (one of the \Concrete\Core\File\Type\Type::T_.

.. constants).

Parameters

int $value

Return Value

Type Returns the class instance itself for method chaining

string getGenericDisplayType()

Get the name of the generic category type.

Return Value

string

string getName()

Get the name (empty string if generic type).

Return Value

string

Type setName(string $value)

Set the name (empty string if generic type).

Parameters

string $value

Return Value

Type Returns the class instance itself for method chaining

string getDisplayName()

Get the display name (localized).

Return Value

string

string getExtension()

Get the single file extension.

Return Value

string

Type setExtension(string $value)

Set the single file extension.

Parameters

string $value

Return Value

Type Returns the class instance itself for method chaining

string getCustomImporter()

Get the handle of the custom importer (empty string if not available).

Return Value

string

Type setCustomImporter(string $value)

Set the handle of the custom importer (empty string if not available).

Parameters

string $value

Return Value

Type Returns the class instance itself for method chaining

string getEditor()

Get the handle of the editor (empty string if not available).

Return Value

string

Type setEditor(string $value)

Set the handle of the editor (empty string if not available).

Parameters

string $value

Return Value

Type Returns the class instance itself for method chaining

string getView()

Get the handle of the inline viewer (empty string if not available).

Return Value

string

Type setView(string $value)

Set the handle of the inline viewer (empty string if not available).

Parameters

string $value

Return Value

Type Returns the class instance itself for method chaining

Inspector|null getCustomInspector()

Get the inspector for this file type (if available).

Return Value

Inspector|null

static string[] getUsedExtensionList()

Get the list of all the file extensions used by approved file versions.

Return Value

string[]

static int[] getUsedTypeList()

Get the list of all the file types used by approved file versions.

Return Value

int[]

static int[] getTypeList()

Get the list of all the available type IDs.

Return Value

int[]

string getThumbnail(bool $fullImageTag = true)

Returns a thumbnail for this type of file.

Parameters

bool $fullImageTag Set to true to retrieve the full HTML image tag, false to just retrieve the image URL

Return Value

string

bool|null supportsThumbnails()

Does the file type support thumbnails.

Return Value

bool|null Return true if the type supports thumbnails, null otherwise

bool|null isSVG()

Is the file type an SVG.

Return Value

bool|null Return true if the type is an SVG, null otherwise

static string|null getGenericTypeText(int $type)

Get the name of a generic file type.

Parameters

int $type Generic category type (one of the \Concrete\Core\File\Type\Type::T_... constants)

Return Value

string|null Returns null if the type is not recognized, its translated display name otherwise