phpDocumentor

ProductsContentFileStorage extends AbstractFileStorage
in package

Class AbstractFileStorage

Table of Contents

$storageDirectory  : WritableDirectory
Storage Directory.
__construct()  : mixed
ProductsContentFileStorage constructor.
deleteFile()  : AbstractFileStorage
Delete File
fileExists()  : bool
File Exists
getFileList()  : array<string|int, mixed>
Returns a file list for a directory.
importFile()  : string
Import File
renameFile()  : AbstractFileStorage
Rename File
_createAndReturnNewFilename()  : string
Create and Return the New Filename
_validateFile()  : AbstractFileStorage
Validates the provided file.
_validateFilename()  : AbstractFileStorage
Validates the provided filename.

Properties

Methods

__construct()

ProductsContentFileStorage constructor.

public __construct() : mixed

Overridden parent constructor, no arguments required.

Return values
mixed

getFileList()

Returns a file list for a directory.

public getFileList(WritableDirectory $directory[, array<string|int, mixed> $extensions = [] ]) : array<string|int, mixed>
Parameters
$directory : WritableDirectory

Directory to scan.

$extensions : array<string|int, mixed> = []

File extensions (optional).

Return values
array<string|int, mixed>

renameFile()

Rename File

public renameFile(FilenameStringType $oldName, FilenameStringType $newName) : AbstractFileStorage

Renames an existing image file.

Parameters
$oldName : FilenameStringType

The old name of the file.

$newName : FilenameStringType

The new name of the file.

Tags
throws
InvalidArgumentException

If a file with the preferred name already exists.

throws
InvalidArgumentException

If the file that should be renamed does not exists.

Return values
AbstractFileStorage

Same instance for chained method calls.

_createAndReturnNewFilename()

Create and Return the New Filename

protected _createAndReturnNewFilename(FilenameStringType $existingFilename) : string

Checks whether the provided preferred filename already exists and generates one, with appending the next available number, which does not already exist.

Parameters
$existingFilename : FilenameStringType

The existing filename to change.

Tags
throws
InvalidArgumentException
Return values
string

The created filename

Search results