MediaLibraryItem
        
        Represents a file or folder in the Media Library.
    
    
 class System\Classes\MediaLibraryItemConstants
| 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
public $lastModified : int
Contains the last modification time (Unix timestamp).
public $path : string
Specifies the item path relative to the Library root.
public $publicUrl : string
Specifies the public URL of the item.
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.
public $type : string
Specifies the item type.
protected static $audioExtensions : array
Contains a default list of audio files and directories to ignore. Override with config: cms.storage.media.audioExtensions
protected static $imageExtensions : array
Contains a default list of image files and directories to ignore. Override with config: cms.storage.media.imageExtensions
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 (string $path, int $size, int $lastModified, string $type, string $publicUrl)
| Property | Type | Description | 
|---|---|---|
| $path | string | string | 
| $size | int | int | 
| $lastModified | int | int | 
| $type | string | string | 
| $publicUrl | string | string | 
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.
public isFile () : bool
public lastModifiedAsString () : string
Returns the item last modification date as string.
Returns the item's last modification date as string.
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.
Extended by
| Class | Description | 
|---|---|
| MediaLibraryItem | Represents a file or folder in the Media Library. |