PHP Class eZ\Publish\Core\FieldType\Image\IO\Legacy

Acts as a dispatcher between the two IOService instances required by FieldType\Image in Legacy. - One is the usual one, as used in ImageStorage, that uses 'images' as the prefix - The other is a special one, that uses 'images-versioned' as the prefix, in order to cope with content created from the backoffice To load a binary file, this service will first try with the normal IOService, and on exception, will fall back to the draft IOService. In addition, loadBinaryFile() will also hide the need to explicitly call getExternalPath() on the internal path stored in legacy.
Inheritance: implements eZ\Publish\Core\IO\IOServiceInterface
Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( eZ\Publish\Core\IO\IOServiceInterface $publishedIOService, eZ\Publish\Core\IO\IOServiceInterface $draftIOService, eZ\Publish\Core\FieldType\Image\IO\OptionsProvider $optionsProvider )
createBinaryFile ( BinaryFileCreateStruct $binaryFileCreateStruct )
deleteBinaryFile ( BinaryFile $binaryFile )
deleteDirectory ( string $path ) Deletes a directory.
exists ( $binaryFileId )
getExternalPath ( $internalId )
getFileContents ( BinaryFile $binaryFile )
getFileInputStream ( BinaryFile $binaryFile )
getInternalPath ( $externalId )
getMimeType ( $binaryFileId )
getUri ( $binaryFileId )
loadBinaryFile ( $binaryFileId )
loadBinaryFileByUri ( $binaryFileUri ) Since both services should use the same uri, we can use any of them to *GET* the URI.
newBinaryCreateStructFromLocalFile ( $localFile )
newBinaryCreateStructFromUploadedFile ( array $uploadedFile )
setPrefix ( $prefix ) Sets the IOService prefix.

Méthodes protégées

Méthode Description
isDraftImagePath ( string $internalPath ) : boolean Checks if $internalPath is a published image path.
isPublishedImagePath ( string $internalPath ) : boolean Checks if $internalPath is a published image path.

Private Methods

Méthode Description
setPrefixes ( ) Computes the paths to published & draft images path using the options from the provider.

Method Details

__construct() public méthode

public __construct ( eZ\Publish\Core\IO\IOServiceInterface $publishedIOService, eZ\Publish\Core\IO\IOServiceInterface $draftIOService, eZ\Publish\Core\FieldType\Image\IO\OptionsProvider $optionsProvider )
$publishedIOService eZ\Publish\Core\IO\IOServiceInterface
$draftIOService eZ\Publish\Core\IO\IOServiceInterface
$optionsProvider eZ\Publish\Core\FieldType\Image\IO\OptionsProvider

createBinaryFile() public méthode

public createBinaryFile ( BinaryFileCreateStruct $binaryFileCreateStruct )
$binaryFileCreateStruct eZ\Publish\Core\IO\Values\BinaryFileCreateStruct

deleteBinaryFile() public méthode

public deleteBinaryFile ( BinaryFile $binaryFile )
$binaryFile eZ\Publish\Core\IO\Values\BinaryFile

deleteDirectory() public méthode

Deletes a directory.
public deleteDirectory ( string $path )
$path string

exists() public méthode

public exists ( $binaryFileId )

getExternalPath() public méthode

public getExternalPath ( $internalId )

getFileContents() public méthode

public getFileContents ( BinaryFile $binaryFile )
$binaryFile eZ\Publish\Core\IO\Values\BinaryFile

getFileInputStream() public méthode

public getFileInputStream ( BinaryFile $binaryFile )
$binaryFile eZ\Publish\Core\IO\Values\BinaryFile

getInternalPath() public méthode

public getInternalPath ( $externalId )

getMimeType() public méthode

public getMimeType ( $binaryFileId )

getUri() public méthode

public getUri ( $binaryFileId )

isDraftImagePath() protected méthode

Checks if $internalPath is a published image path.
protected isDraftImagePath ( string $internalPath ) : boolean
$internalPath string
Résultat boolean true if $internalPath is the path to a published image

isPublishedImagePath() protected méthode

Checks if $internalPath is a published image path.
protected isPublishedImagePath ( string $internalPath ) : boolean
$internalPath string
Résultat boolean true if $internalPath is the path to a published image

loadBinaryFile() public méthode

public loadBinaryFile ( $binaryFileId )

loadBinaryFileByUri() public méthode

Since both services should use the same uri, we can use any of them to *GET* the URI.
public loadBinaryFileByUri ( $binaryFileUri )

newBinaryCreateStructFromLocalFile() public méthode

public newBinaryCreateStructFromLocalFile ( $localFile )

newBinaryCreateStructFromUploadedFile() public méthode

public newBinaryCreateStructFromUploadedFile ( array $uploadedFile )
$uploadedFile array

setPrefix() public méthode

Sets the IOService prefix.
public setPrefix ( $prefix )