PHP Класс Spatie\MediaLibrary\FileAdder\FileAdder

Показать файл Открыть проект

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

Свойство Тип Описание
$config Illuminate\Contracts\Cache\Repository
$customProperties array
$diskName string
$file string | Symfony\Component\HttpFoundation\File\UploadedFile
$fileName string
$filesystem Spatie\MediaLibrary\Filesystem
$mediaName string
$pathToFile string
$preserveOriginal boolean
$properties array
$subject subject

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

Метод Описание
__construct ( Filesystem $fileSystem, Illuminate\Contracts\Cache\Repository $config )
preservingOriginal ( ) When adding the file to the media library, the original file will be preserved.
setFile ( string | Symfony\Component\HttpFoundation\File\UploadedFile $file ) Set the file that needs to be imported.
setFileName ( string $fileName ) Set the name of the file that is stored on disk.
setName ( string $name ) Set the name of the media object.
setSubject ( Model $subject ) : FileAdder
toCollection ( string $collectionName = 'default', string $diskName = '' ) : Media Set the collection name where to import the file.
toCollectionOnDisk ( string $collectionName = 'default', string $diskName = '' ) : Media
toMediaLibrary ( string $collectionName = 'default', string $diskName = '' ) : Media Set the target media collection to default.
toMediaLibraryOnDisk ( string $collectionName = 'default', string $diskName = '' ) : Media Set the target media collection to default.
usingFileName ( string $fileName ) Set the name of the file that is stored on disk.
usingName ( string $name ) Set the name of the media object.
withAttributes ( array $properties ) Set attributes on the model.
withCustomProperties ( array $customProperties ) Set the metadata.
withProperties ( array $properties ) Set properties on the model.

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

Метод Описание
determineDiskName ( string $diskName ) : string Determine the disk to be used.
sanitizeFileName ( string $fileName ) : string Sanitize the given file name.

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

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

public __construct ( Filesystem $fileSystem, Illuminate\Contracts\Cache\Repository $config )
$fileSystem Spatie\MediaLibrary\Filesystem
$config Illuminate\Contracts\Cache\Repository

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

Determine the disk to be used.
protected determineDiskName ( string $diskName ) : string
$diskName string
Результат string

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

When adding the file to the media library, the original file will be preserved.
public preservingOriginal ( )

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

Sanitize the given file name.
protected sanitizeFileName ( string $fileName ) : string
$fileName string
Результат string

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

Set the file that needs to be imported.
public setFile ( string | Symfony\Component\HttpFoundation\File\UploadedFile $file )
$file string | Symfony\Component\HttpFoundation\File\UploadedFile

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

Set the name of the file that is stored on disk.
public setFileName ( string $fileName )
$fileName string

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

Set the name of the media object.
public setName ( string $name )
$name string

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

public setSubject ( Model $subject ) : FileAdder
$subject Illuminate\Database\Eloquent\Model
Результат FileAdder

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

Will also start the import process.
public toCollection ( string $collectionName = 'default', string $diskName = '' ) : Media
$collectionName string
$diskName string
Результат Spatie\MediaLibrary\Media

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

public toCollectionOnDisk ( string $collectionName = 'default', string $diskName = '' ) : Media
$collectionName string
$diskName string
Результат Spatie\MediaLibrary\Media

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

Will also start the import process.
public toMediaLibrary ( string $collectionName = 'default', string $diskName = '' ) : Media
$collectionName string
$diskName string
Результат Spatie\MediaLibrary\Media

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

Will also start the import process.
public toMediaLibraryOnDisk ( string $collectionName = 'default', string $diskName = '' ) : Media
$collectionName string
$diskName string
Результат Spatie\MediaLibrary\Media

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

Set the name of the file that is stored on disk.
public usingFileName ( string $fileName )
$fileName string

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

Set the name of the media object.
public usingName ( string $name )
$name string

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

Set attributes on the model.
public withAttributes ( array $properties )
$properties array

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

Set the metadata.
public withCustomProperties ( array $customProperties )
$customProperties array

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

Set properties on the model.
public withProperties ( array $properties )
$properties array

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

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

protected Repository,Illuminate\Contracts\Cache $config
Результат Illuminate\Contracts\Cache\Repository

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

protected array $customProperties
Результат array

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

protected string $diskName
Результат string

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

protected string|UploadedFile,Symfony\Component\HttpFoundation\File $file
Результат string | Symfony\Component\HttpFoundation\File\UploadedFile

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

protected string $fileName
Результат string

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

protected Filesystem,Spatie\MediaLibrary $filesystem
Результат Spatie\MediaLibrary\Filesystem

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

protected string $mediaName
Результат string

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

protected string $pathToFile
Результат string

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

protected bool $preserveOriginal
Результат boolean

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

protected array $properties
Результат array

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

subject
protected $subject