PHP 인터페이스 Spatie\MediaLibrary\HasMedia\Interfaces\HasMedia

파일 보기 프로젝트 열기: spatie/laravel-medialibrary

공개 메소드들

메소드 설명
addMedia ( string | Symfony\Component\HttpFoundation\File\UploadedFile $file ) : FileAdder Move a file to the medialibrary.
clearMediaCollection ( string $collectionName = 'default' ) Remove all media in the given collection.
copyMedia ( string | Symfony\Component\HttpFoundation\File\UploadedFile $file ) : FileAdder Copy a file to the medialibrary.
getMedia ( string $collectionName = 'default', array | callable $filters = [] ) : Media Get media collection by its collectionName.
hasMedia ( string $collectionMedia = '' ) : boolean Determine if there is media in the given collection.
media ( ) : mixed Set the polymorphic relation.
shouldDeletePreservingMedia ( ) : Media Determines if the media files should be preserved when the media object gets deleted.

메소드 상세

addMedia() 공개 메소드

Move a file to the medialibrary.
public addMedia ( string | Symfony\Component\HttpFoundation\File\UploadedFile $file ) : FileAdder
$file string | Symfony\Component\HttpFoundation\File\UploadedFile
리턴 Spatie\MediaLibrary\FileAdder\FileAdder

clearMediaCollection() 공개 메소드

Remove all media in the given collection.
public clearMediaCollection ( string $collectionName = 'default' )
$collectionName string

copyMedia() 공개 메소드

Copy a file to the medialibrary.
public copyMedia ( string | Symfony\Component\HttpFoundation\File\UploadedFile $file ) : FileAdder
$file string | Symfony\Component\HttpFoundation\File\UploadedFile
리턴 Spatie\MediaLibrary\FileAdder\FileAdder

getMedia() 공개 메소드

Get media collection by its collectionName.
public getMedia ( string $collectionName = 'default', array | callable $filters = [] ) : Media
$collectionName string
$filters array | callable
리턴 Spatie\MediaLibrary\Media

hasMedia() 공개 메소드

Determine if there is media in the given collection.
public hasMedia ( string $collectionMedia = '' ) : boolean
$collectionMedia string
리턴 boolean

media() 공개 메소드

Set the polymorphic relation.
public media ( ) : mixed
리턴 mixed

shouldDeletePreservingMedia() 공개 메소드

Determines if the media files should be preserved when the media object gets deleted.
public shouldDeletePreservingMedia ( ) : Media
리턴 Spatie\MediaLibrary\Media