PHP Класс Plank\Mediable\Media

Автор: Sean Fraser ([email protected])
Наследование: extends Illuminate\Database\Eloquent\Model
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$guarded

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

Метод Описание
boot ( )
contents ( ) : string Retrieve the contents of the file.
fileExists ( ) : boolean Check if the file exists on disk.
getAbsolutePath ( ) : string Get the absolute filesystem path to the file.
getBasenameAttribute ( ) : string Retrieve the file extension.
getDiskPath ( ) : string Get the path to the file relative to the root of the disk.
getUrl ( ) : string Get the absolute URL to the media file.
isPubliclyAccessible ( ) : boolean Check if the file is located below the public webroot.
models ( string $class ) : Illuminate\Database\Eloquent\Relations\MorphToMany Retrieve all associated models of given class.
move ( string $destination, string $filename = null ) : void Move the file to a new location on disk.
readableSize ( integer $precision = 1 ) : string Calculate the file size in human readable byte notation.
rename ( $filename ) : void Rename the file in place.
scopeForPathOnDisk ( Builder $q, string $disk, string $path ) : void Query scope finding media at a path relative to a disk.
scopeInDirectory ( Builder $q, string $disk, string $directory, boolean $recursive = false ) : void Query scope for to find media in a particular directory.
scopeInOrUnderDirectory ( Builder $q, string $disk, string $directory ) : void Query scope for finding media in a particular directory or one of its subdirectories.
scopeUnordered ( Builder $q ) : void Query scope to remove the order by clause from the query.
scopeWhereBasename ( Builder $q, string $basename ) : void Query scope for finding media by basename.

Защищенные методы

Метод Описание
getUrlGenerator ( ) : Plank\Mediable\UrlGenerators\UrlGenerator Get a UrlGenerator instance for the media.
handleMediaDeletion ( )
storage ( ) : Illuminate\Contracts\Filesystem\Filesystem Get the filesystem object for this media.

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

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

public static boot ( )

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

Retrieve the contents of the file.
public contents ( ) : string
Результат string

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

Check if the file exists on disk.
public fileExists ( ) : boolean
Результат boolean

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

Get the absolute filesystem path to the file.
public getAbsolutePath ( ) : string
Результат string

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

Retrieve the file extension.
public getBasenameAttribute ( ) : string
Результат string

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

Get the path to the file relative to the root of the disk.
public getDiskPath ( ) : string
Результат string

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

Get the absolute URL to the media file.
public getUrl ( ) : string
Результат string

getUrlGenerator() защищенный Метод

Get a UrlGenerator instance for the media.
protected getUrlGenerator ( ) : Plank\Mediable\UrlGenerators\UrlGenerator
Результат Plank\Mediable\UrlGenerators\UrlGenerator

handleMediaDeletion() защищенный Метод

protected handleMediaDeletion ( )

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

Check if the file is located below the public webroot.
public isPubliclyAccessible ( ) : boolean
Результат boolean

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

Retrieve all associated models of given class.
public models ( string $class ) : Illuminate\Database\Eloquent\Relations\MorphToMany
$class string FQCN
Результат Illuminate\Database\Eloquent\Relations\MorphToMany

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

Will invoke the save() method on the model after the associated file has been moved to prevent synchronization errors
public move ( string $destination, string $filename = null ) : void
$destination string directory relative to disk root
$filename string filename. Do not include extension
Результат void

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

Calculate the file size in human readable byte notation.
public readableSize ( integer $precision = 1 ) : string
$precision integer (_optional_) Number of decimal places to include.
Результат string

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

Rename the file in place.
См. также: Plank\Mediable\Media::move()
public rename ( $filename ) : void
Результат void

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

Query scope finding media at a path relative to a disk.
public scopeForPathOnDisk ( Builder $q, string $disk, string $path ) : void
$q Illuminate\Database\Eloquent\Builder
$disk string
$path string directory, filename and extension
Результат void

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

Query scope for to find media in a particular directory.
public scopeInDirectory ( Builder $q, string $disk, string $directory, boolean $recursive = false ) : void
$q Illuminate\Database\Eloquent\Builder
$disk string Filesystem disk to search in
$directory string Path relative to disk
$recursive boolean (_optional_) If true, will find media in or under the specified directory
Результат void

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

Query scope for finding media in a particular directory or one of its subdirectories.
public scopeInOrUnderDirectory ( Builder $q, string $disk, string $directory ) : void
$q Illuminate\Database\Eloquent\Builder
$disk string Filesystem disk to search in
$directory string Path relative to disk
Результат void

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

Query scope to remove the order by clause from the query.
public scopeUnordered ( Builder $q ) : void
$q Illuminate\Database\Eloquent\Builder
Результат void

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

Query scope for finding media by basename.
public scopeWhereBasename ( Builder $q, string $basename ) : void
$q Illuminate\Database\Eloquent\Builder
$basename string filename and extension
Результат void

storage() защищенный Метод

Get the filesystem object for this media.
protected storage ( ) : Illuminate\Contracts\Filesystem\Filesystem
Результат Illuminate\Contracts\Filesystem\Filesystem

Описание свойств

$guarded защищенное свойство

protected $guarded