PHP Class MediaModel, addons

Inheritance: extends Ajde_Model
Afficher le fichier Open project: vanilla/addons Class Usage Examples

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

MediaModel constructor.
public __construct ( )

delete() public méthode

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 méthode

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

getID() public méthode

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.
Résultat array | false Returns the media row or **false** if it isn't found.

getImageSize() public static méthode

If passed path leads to an image, return size
public static getImageSize ( string $Path ) : array
$Path string Path to file.
Résultat array [0] => Height, [1] => Width.

pathUploads() public static méthode

Return path to upload folder.
public static pathUploads ( ) : string
Résultat string Path to upload folder.

preloadDiscussionMedia() public méthode

public preloadDiscussionMedia ( $DiscussionID, $CommentIDList ) : Gdn_DataSet
$DiscussionID
$CommentIDList
Résultat Gdn_DataSet

reassign() public méthode

Retrieve all media for a foreign record.
public reassign ( integer $ForeignID, string $ForeignTable, $NewForeignID, $NewForeignTable ) : object
$ForeignID integer
$ForeignTable string Lowercase.
Résultat object SQL results.

thumbnailHeight() public static méthode

public static thumbnailHeight ( ) : boolean | mixed
Résultat boolean | mixed

thumbnailUrl() public static méthode

public static thumbnailUrl ( &$Media ) : mixed | string
$Media
Résultat mixed | string

thumbnailWidth() public static méthode

public static thumbnailWidth ( ) : boolean | mixed
Résultat boolean | mixed

url() public static méthode

public static url ( $Media ) : mixed | string
$Media
Résultat mixed | string