Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • ApiV2Controllers
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • None
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

  • AbstractFileStorage
  • ImageFileStorage

Class AbstractFileStorage

Class AbstractFileStorage

Direct known subclasses

ImageFileStorage

Indirect known subclasses

ProductImageFileStorage

Abstract
Package: Shared\Storage
Category: System
Located at Shared/Storages/AbstractFileStorage.inc.php

Methods summary

public
# __construct( WritableDirectory $storageDirectory )

AbstractFileStorage constructor.

AbstractFileStorage constructor.

Parameters

$storageDirectory
public string
# importFile( ExistingFile $sourceFile, FilenameStringType $preferredFilename )

Import File.

Import File.

Saves an image to a writable directory.

Parameters

$sourceFile
The source file to import.
$preferredFilename
The preferred name of the file to be saved.

Returns

string
The created filename

Throws

InvalidArgumentException
public AbstractFileStorage
# renameFile( FilenameStringType $oldName, FilenameStringType $newName )

Rename File

Rename File

Renames an existing image file.

Parameters

$oldName
The old name of the file.
$newName
The new name of the file.

Returns

AbstractFileStorage
Same instance for chained method calls.

Throws

InvalidArgumentException
If the file that should be renamed does not exists.
InvalidArgumentException
If a file with the preferred name already exists.
public boolean
# fileExists( FilenameStringType $filename )

File Exists.

File Exists.

Checks if the provided file exists.

Parameters

$filename
The filename of the file to be checked.

Returns

boolean
public AbstractFileStorage
# deleteFile( FilenameStringType $filename )

Delete File.

Delete File.

Deletes an existing file.

Parameters

$filename
The file to delete.

Returns

AbstractFileStorage
Same instance for chained method calls.
abstract protected AbstractFileStorage
# _validateFile( ExistingFile $sourceFile )

Validates the provided file.

Validates the provided file.

Parameters

$sourceFile
The file to validate.

Returns

AbstractFileStorage
Same instance for chained method calls.

Throws

InvalidArgumentException
protected string
# _createAndReturnNewFilename( FilenameStringType $existingFilename )

Create and Return the New Filename

Create and Return the New Filename

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

Parameters

$existingFilename
The existing filename to change.

Returns

string
The created filename

Throws

InvalidArgumentException

Properties summary

protected WritableDirectory $storageDirectory

Storage Directory.

Storage Directory.

#
API documentation generated by ApiGen