MediaLibraryItem
Represents a file or folder in the Media Library.
class Cms\Classes\MediaLibraryItem
extends System\Classes\MediaLibraryItem
Extends
Class | Description |
---|---|
MediaLibraryItem
|
Represents a file or folder in the Media Library. |
Constants
Constant | Type | Value | Description |
---|---|---|---|
FILE_TYPE_AUDIO
|
string |
"audio"
|
string
"audio"
|
FILE_TYPE_DOCUMENT
|
string |
"document"
|
string
"document"
|
FILE_TYPE_IMAGE
|
string |
"image"
|
string
"image"
|
FILE_TYPE_VIDEO
|
string |
"video"
|
string
"video"
|
TYPE_FILE
|
string |
"file"
|
string
"file"
|
TYPE_FOLDER
|
string |
"folder"
|
string
"folder"
|
Properties
inherited public $lastModified : int
Contains the last modification time (Unix timestamp).
inherited public $path : string
Specifies the item path relative to the Library root.
inherited public $publicUrl : string
Specifies the public URL of the item.
inherited public $size : int
Specifies the item size. For files the item size is measured in bytes. For folders it contains the number of files in the folder.
inherited public $type : string
Specifies the item type.
inherited protected static $audioExtensions : array
Contains a default list of audio files and directories to ignore. Override with config: cms.storage.media.audioExtensions
inherited protected static $imageExtensions : array
Contains a default list of image files and directories to ignore. Override with config: cms.storage.media.imageExtensions
inherited protected static $videoExtensions : array
Contains a default list of video files and directories to ignore. Override with config: cms.storage.media.videoExtensions
Methods
public __construct ()
inherited public getFileType () : string
Returns the file type by its name.
The known file types are: image, video, audio, document
Returns the file type or NULL if the item is a folder.
inherited public isFile () : bool
inherited public lastModifiedAsString () : string
Returns the item last modification date as string.
Returns the item's last modification date as string.
inherited public sizeToString () : string
Returns the item size as string.
For file-type items the size is the number of bytes. For folder-type items the size is the number of items contained by the item.
Returns the size as string.