SlideImageFileStorage
extends ImageFileStorage
in package
Class SlideImageFileStorage
Tags
Table of Contents
- $imagesDirectory : WritableDirectory
- Slide image directory.
- $settings : EnvSlideImageFileStorageSettings
- Settings
- $storageDirectory : WritableDirectory
- Storage Directory.
- $thumbnailImagesDirectory : WritableDirectory
- Slide thumbnail image directory.
- $validExtensions : array<string|int, mixed>
- Valid file extensions.
- __construct() : mixed
- SlideImageFileStorage constructor.
- deleteFile() : AbstractFileStorage
- Delete File
- deleteImage() : AbstractFileStorage
- Deletes an existing slider image.
- deleteThumbnailImage() : AbstractFileStorage
- Deletes an existing slider thumbnail image.
- fileExists() : bool
- File Exists
- getFileList() : array<string|int, mixed>
- Returns a file list for a directory.
- getImages() : array<string|int, mixed>
- Returns an array of slide images.
- getThumbnailImages() : array<string|int, mixed>
- Returns an array of slide thumbnail images.
- imageExists() : bool
- Checks if the provided slider image exists.
- importFile() : string
- Import File
- importImage() : string
- Saves a slide image file to a writable directory.
- importThumbnailImage() : string
- Saves a slide thumbnail image file to a writable directory.
- renameFile() : AbstractFileStorage
- Rename File
- renameImage() : AbstractFileStorage
- Renames an existing slide image file.
- renameThumbnailImage() : AbstractFileStorage
- Renames an existing slide thumbnail image file.
- thumbnailImageExists() : bool
- Checks if the provided slider thumbnail image exists.
- _createAndReturnNewFilename() : string
- Create and Return the New Filename
- _validateFile() : AbstractFileStorage
- Validates the provided file.
- _validateFilename() : AbstractFileStorage
- Validates the provided filename.
Properties
$imagesDirectory
Slide image directory.
protected
WritableDirectory
$imagesDirectory
$settings
Settings
protected
EnvSlideImageFileStorageSettings
$settings
$storageDirectory
Storage Directory.
protected
WritableDirectory
$storageDirectory
$thumbnailImagesDirectory
Slide thumbnail image directory.
protected
WritableDirectory
$thumbnailImagesDirectory
$validExtensions
Valid file extensions.
protected
array<string|int, mixed>
$validExtensions
= []
Methods
__construct()
SlideImageFileStorage constructor.
public
__construct(SlideImagePathsSettingsInterface $settings) : mixed
Parameters
- $settings : SlideImagePathsSettingsInterface
-
Slide image path settings.
Return values
mixed —deleteFile()
Delete File
public
deleteFile(FilenameStringType $filename) : AbstractFileStorage
Deletes an existing file.
Parameters
- $filename : FilenameStringType
-
The file to delete.
Return values
AbstractFileStorage —Same instance for chained method calls.
deleteImage()
Deletes an existing slider image.
public
deleteImage(FilenameStringType $filename) : AbstractFileStorage
Parameters
- $filename : FilenameStringType
-
The file to delete.
Return values
AbstractFileStorage —Same instance for chained method calls.
deleteThumbnailImage()
Deletes an existing slider thumbnail image.
public
deleteThumbnailImage(FilenameStringType $filename) : AbstractFileStorage
Parameters
- $filename : FilenameStringType
-
The file to delete.
Return values
AbstractFileStorage —Same instance for chained method calls.
fileExists()
File Exists
public
fileExists(FilenameStringType $filename) : bool
Checks if the provided file exists.
Parameters
- $filename : FilenameStringType
-
The filename of the file to be checked.
Return values
bool —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> —getImages()
Returns an array of slide images.
public
getImages() : array<string|int, mixed>
Return values
array<string|int, mixed> —Found files.
getThumbnailImages()
Returns an array of slide thumbnail images.
public
getThumbnailImages() : array<string|int, mixed>
Return values
array<string|int, mixed> —Found files.
imageExists()
Checks if the provided slider image exists.
public
imageExists(FilenameStringType $filename) : bool
Parameters
- $filename : FilenameStringType
-
The filename of the slider image file to be checked.
Return values
bool —Does it exist?
importFile()
Import File
public
importFile(ExistingFile $sourceFile, FilenameStringType $preferredFilename) : string
Saves an image to a writable directory.
Parameters
- $sourceFile : ExistingFile
-
The source file to import.
- $preferredFilename : FilenameStringType
-
The preferred name of the file to be saved.
Tags
Return values
string —The created filename
importImage()
Saves a slide image file to a writable directory.
public
importImage(ExistingFile $sourceFile, FilenameStringType $preferredFilename) : string
Parameters
- $sourceFile : ExistingFile
-
The source file to import.
- $preferredFilename : FilenameStringType
-
The preferred name of the file to be saved.
Tags
Return values
string —Preferred filename
importThumbnailImage()
Saves a slide thumbnail image file to a writable directory.
public
importThumbnailImage(ExistingFile $sourceFile, FilenameStringType $preferredFilename) : string
Parameters
- $sourceFile : ExistingFile
-
The source file to import.
- $preferredFilename : FilenameStringType
-
The preferred name of the file to be saved.
Tags
Return values
string —Preferred filename
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
Return values
AbstractFileStorage —Same instance for chained method calls.
renameImage()
Renames an existing slide image file.
public
renameImage(FilenameStringType $oldName, FilenameStringType $newName) : AbstractFileStorage
Parameters
- $oldName : FilenameStringType
-
The old name of the file.
- $newName : FilenameStringType
-
The new name of the file.
Tags
Return values
AbstractFileStorage —Same instance for chained method calls.
renameThumbnailImage()
Renames an existing slide thumbnail image file.
public
renameThumbnailImage(FilenameStringType $oldName, FilenameStringType $newName) : AbstractFileStorage
Parameters
- $oldName : FilenameStringType
-
The old name of the file.
- $newName : FilenameStringType
-
The new name of the file.
Tags
Return values
AbstractFileStorage —Same instance for chained method calls.
thumbnailImageExists()
Checks if the provided slider thumbnail image exists.
public
thumbnailImageExists(FilenameStringType $filename) : bool
Parameters
- $filename : FilenameStringType
-
The filename of the slider thumbnail image file to be checked.
Return values
bool —Does it exist?
_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
Return values
string —The created filename
_validateFile()
Validates the provided file.
protected
abstract _validateFile(ExistingFile $sourceFile) : AbstractFileStorage
Parameters
- $sourceFile : ExistingFile
-
The file to validate.
Tags
Return values
AbstractFileStorage —Same instance for chained method calls.
_validateFilename()
Validates the provided filename.
protected
abstract _validateFilename(FilenameStringType $filename) : AbstractFileStorage
Parameters
- $filename : FilenameStringType
-
The filename to validate.
Tags
Return values
AbstractFileStorage —Same instance for chained method calls.