class ImportOptions (View source)

Options to be used when importing a file.

Properties

protected StorageLocationFactory $storageLocationFactory
protected Filesystem $filesystem
private FileFolder|null $importToFolder
private File|null $addNewFileVersion
private StorageLocation|null $storageLocation
private string $customPrefix
private bool $skipThumbnailGeneration

Skip the thumbnail generation?

private bool $canChangeLocalFile

Can the local file be changed by file processors? If no, we'll create a copy of the file being imported.

Methods

__construct(Filesystem $filesystem, StorageLocationFactory $storageLocationFactory)

Initialize the instance.

$this
setImportToFolder(FileFolder $folder)

The import process should create new files in a specific folder.

$this
setAddNewVersionTo(File $toFile)

The import process should add a new Version to an existing File.

getImportToFolder()

The import process should store the file in this folder.

File|null
getAddNewVersionTo()

The import process should add a new file Version to this File object (NULL: no).

getStorageLocation()

Get the storage location where imported files should be saved to.

$this
setCustomPrefix(string $value)

Set the custom prefix to be used to store the file.

string
getCustomPrefix()

Get the custom prefix to be used to store the file.

bool
isSkipThumbnailGeneration()

Skip the thumbnail generation?

$this
setSkipThumbnailGeneration(bool $value)

Skip the thumbnail generation?

bool
canChangeLocalFile()

Can the local file be changed by file processors? If no, we'll create a copy of the file being imported.

$this
setCanChangeLocalFile(bool $value)

Can the local file be changed by file processors? If no, we'll create a copy of the file being imported.

getFileStorageLocation(File $file)

Get the storage location associated to a file.

getFolderStorageLocation(FileFolder $folder)

Get the storage location associated to a folder.

Details

__construct(Filesystem $filesystem, StorageLocationFactory $storageLocationFactory)

Initialize the instance.

Parameters

Filesystem $filesystem
StorageLocationFactory $storageLocationFactory

$this setImportToFolder(FileFolder $folder)

The import process should create new files in a specific folder.

Parameters

FileFolder $folder

Return Value

$this

$this setAddNewVersionTo(File $toFile)

The import process should add a new Version to an existing File.

Parameters

File $toFile

Return Value

$this

FileFolder getImportToFolder()

The import process should store the file in this folder.

Return Value

FileFolder

Exceptions

ImportException

File|null getAddNewVersionTo()

The import process should add a new file Version to this File object (NULL: no).

Return Value

File|null

StorageLocation getStorageLocation()

Get the storage location where imported files should be saved to.

Return Value

StorageLocation

$this setCustomPrefix(string $value)

Set the custom prefix to be used to store the file.

Make sure it conforms to standards (e.g. it is 12 digits, numeric only).

Parameters

string $value

Return Value

$this

string getCustomPrefix()

Get the custom prefix to be used to store the file.

Return Value

string

bool isSkipThumbnailGeneration()

Skip the thumbnail generation?

Return Value

bool

$this setSkipThumbnailGeneration(bool $value)

Skip the thumbnail generation?

Parameters

bool $value

Return Value

$this

bool canChangeLocalFile()

Can the local file be changed by file processors? If no, we'll create a copy of the file being imported.

Return Value

bool

$this setCanChangeLocalFile(bool $value)

Can the local file be changed by file processors? If no, we'll create a copy of the file being imported.

Parameters

bool $value

Return Value

$this

protected StorageLocation getFileStorageLocation(File $file)

Get the storage location associated to a file.

Parameters

File $file

Return Value

StorageLocation

Exceptions

ImportException

protected StorageLocation getFolderStorageLocation(FileFolder $folder)

Get the storage location associated to a folder.

Parameters

FileFolder $folder

Return Value

StorageLocation

Exceptions

ImportException