ProductImageFileStorage

Extends \ImageFileStorage

Class ProductImageFileStorage

category

System

package

Product

subpackage

Storages

Methods

AbstractFileStorage constructor.

__construct(\WritableDirectory $storageDirectory) 
inherited

Arguments

$storageDirectory

\WritableDirectory

Delete File

deleteFile(\FilenameStringType $filename) : \AbstractFileStorage
inherited

Deletes an existing file.

Arguments

$filename

\FilenameStringType

The file to delete.

Response

\AbstractFileStorage

Same instance for chained method calls.

File Exists

fileExists(\FilenameStringType $filename) : boolean
inherited

Checks if the provided file exists.

Arguments

$filename

\FilenameStringType

The filename of the file to be checked.

Response

boolean

Returns a file list for a directory.

getFileList(\WritableDirectory $directory, array $extensions = array()) : array
inherited

Arguments

$directory

\WritableDirectory

Directory to scan.

$extensions

array

File extensions (optional).

Response

array

Import File

importFile(\ExistingFile $sourceFile, \FilenameStringType $preferredFilename) : string
inherited

Saves an image to a writable directory.

Throws
\InvalidArgumentException

Arguments

$sourceFile

\ExistingFile

The source file to import.

$preferredFilename

\FilenameStringType

The preferred name of the file to be saved.

Response

string

The created filename

Processes an image for the front end.

processImage(\FilenameStringType $productImage) : \ProductImageFileStorage

Arguments

$productImage

\FilenameStringType

Response

\ProductImageFileStorage

Same instance for chained method calls.

Rename File

renameFile(\FilenameStringType $oldName, \FilenameStringType $newName) : \AbstractFileStorage
inherited

Renames an existing image file.

Throws
\InvalidArgumentException

If a file with the preferred name already exists.

\InvalidArgumentException

If the file that should be renamed does not exists.

Arguments

$oldName

\FilenameStringType

The old name of the file.

$newName

\FilenameStringType

The new name of the file.

Response

\AbstractFileStorage

Same instance for chained method calls.

Properties