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 Description
FILE_TYPE_AUDIO
string "audio"
FILE_TYPE_DOCUMENT
string "document"
FILE_TYPE_IMAGE
string "image"
FILE_TYPE_VIDEO
string "video"
TYPE_FILE
string "file"
TYPE_FOLDER
string "folder"

Properties

inherited public $lastModified : int

Inherited from MediaLibraryItem

Contains the last modification time (Unix timestamp).

inherited public $path : string

Inherited from MediaLibraryItem

Specifies the item path relative to the Library root.

inherited public $publicUrl : string

Inherited from MediaLibraryItem

Specifies the public URL of the item.

inherited public $size : int

Inherited from MediaLibraryItem

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

Inherited from MediaLibraryItem

Specifies the item type.

inherited protected static $audioExtensions : array

Inherited from MediaLibraryItem

Contains a default list of audio files and directories to ignore. Override with config: cms.storage.media.audioExtensions

inherited protected static $imageExtensions : array

Inherited from MediaLibraryItem

Contains a default list of image files and directories to ignore. Override with config: cms.storage.media.imageExtensions

inherited protected static $videoExtensions : array

Inherited from MediaLibraryItem

Contains a default list of video files and directories to ignore. Override with config: cms.storage.media.videoExtensions

Methods

public __construct ()

Returns
mixed

inherited public getFileType () : string

Inherited from MediaLibraryItem

Returns the file type by its name.

The known file types are: image, video, audio, document

Returns
string

Returns the file type or NULL if the item is a folder.

inherited public isFile () : bool

Inherited from MediaLibraryItem
Returns
bool

inherited public lastModifiedAsString () : string

Inherited from MediaLibraryItem

Returns the item last modification date as string.

Returns
string

Returns the item's last modification date as string.

inherited public sizeToString () : string

Inherited from MediaLibraryItem

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
string

Returns the size as string.

Copyright © 2024 Winter CMS