PHP Класс MediaModel, addons

Наследование: extends Ajde_Model
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( ) MediaModel constructor.
delete ( array $Media = [], array | boolean $Options = [] )
deleteParent ( $ParentTable, $ParentID )
getID ( integer $MediaID, boolean $DatasetType = false, array $Options = [] ) : array | false Get a media row by ID.
getImageSize ( string $Path ) : array If passed path leads to an image, return size
pathUploads ( ) : string Return path to upload folder.
preloadDiscussionMedia ( $DiscussionID, $CommentIDList ) : Gdn_DataSet
reassign ( integer $ForeignID, string $ForeignTable, $NewForeignID, $NewForeignTable ) : object Retrieve all media for a foreign record.
thumbnailHeight ( ) : boolean | mixed
thumbnailUrl ( &$Media ) : mixed | string
thumbnailWidth ( ) : boolean | mixed
url ( $Media ) : mixed | string

Описание методов

__construct() публичный Метод

MediaModel constructor.
public __construct ( )

delete() публичный Метод

public delete ( array $Media = [], array | boolean $Options = [] )
$Media array The media row.
$Options array | boolean Either a boolean that says whether or not to delete the file or an array with a

deleteParent() публичный Метод

public deleteParent ( $ParentTable, $ParentID )
$ParentTable
$ParentID

getID() публичный Метод

Get a media row by ID.
public getID ( integer $MediaID, boolean $DatasetType = false, array $Options = [] ) : array | false
$MediaID integer The ID of the media entry.
$DatasetType boolean Not used.
$Options array Not used.
Результат array | false Returns the media row or **false** if it isn't found.

getImageSize() публичный статический Метод

If passed path leads to an image, return size
public static getImageSize ( string $Path ) : array
$Path string Path to file.
Результат array [0] => Height, [1] => Width.

pathUploads() публичный статический Метод

Return path to upload folder.
public static pathUploads ( ) : string
Результат string Path to upload folder.

preloadDiscussionMedia() публичный Метод

public preloadDiscussionMedia ( $DiscussionID, $CommentIDList ) : Gdn_DataSet
$DiscussionID
$CommentIDList
Результат Gdn_DataSet

reassign() публичный Метод

Retrieve all media for a foreign record.
public reassign ( integer $ForeignID, string $ForeignTable, $NewForeignID, $NewForeignTable ) : object
$ForeignID integer
$ForeignTable string Lowercase.
Результат object SQL results.

thumbnailHeight() публичный статический Метод

public static thumbnailHeight ( ) : boolean | mixed
Результат boolean | mixed

thumbnailUrl() публичный статический Метод

public static thumbnailUrl ( &$Media ) : mixed | string
$Media
Результат mixed | string

thumbnailWidth() публичный статический Метод

public static thumbnailWidth ( ) : boolean | mixed
Результат boolean | mixed

url() публичный статический Метод

public static url ( $Media ) : mixed | string
$Media
Результат mixed | string