PHP Interface Spatie\MediaLibrary\HasMedia\Interfaces\HasMedia

Afficher le fichier Open project: spatie/laravel-medialibrary

Méthodes publiques

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

Method Details

addMedia() public méthode

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

clearMediaCollection() public méthode

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

copyMedia() public méthode

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

getMedia() public méthode

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

hasMedia() public méthode

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

media() public méthode

Set the polymorphic relation.
public media ( ) : mixed
Résultat mixed

shouldDeletePreservingMedia() public méthode

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