PHP 클래스 Plank\Mediable\Media

저자: Sean Fraser ([email protected])
상속: extends Illuminate\Database\Eloquent\Model
파일 보기 프로젝트 열기: plank/laravel-mediable 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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