PHP Класс 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.
Наследование: implements eZ\Publish\Core\IO\IOServiceInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
isDraftImagePath ( string $internalPath ) : boolean Checks if $internalPath is a published image path.
isPublishedImagePath ( string $internalPath ) : boolean Checks if $internalPath is a published image path.

Приватные методы

Метод Описание
setPrefixes ( ) Computes the paths to published & draft images path using the options from the provider.

Описание методов

__construct() публичный Метод

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 createBinaryFile ( BinaryFileCreateStruct $binaryFileCreateStruct )
$binaryFileCreateStruct eZ\Publish\Core\IO\Values\BinaryFileCreateStruct

deleteBinaryFile() публичный Метод

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

deleteDirectory() публичный Метод

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

exists() публичный Метод

public exists ( $binaryFileId )

getExternalPath() публичный Метод

public getExternalPath ( $internalId )

getFileContents() публичный Метод

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

getFileInputStream() публичный Метод

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

getInternalPath() публичный Метод

public getInternalPath ( $externalId )

getMimeType() публичный Метод

public getMimeType ( $binaryFileId )

getUri() публичный Метод

public getUri ( $binaryFileId )

isDraftImagePath() защищенный Метод

Checks if $internalPath is a published image path.
protected isDraftImagePath ( string $internalPath ) : boolean
$internalPath string
Результат boolean true if $internalPath is the path to a published image

isPublishedImagePath() защищенный Метод

Checks if $internalPath is a published image path.
protected isPublishedImagePath ( string $internalPath ) : boolean
$internalPath string
Результат boolean true if $internalPath is the path to a published image

loadBinaryFile() публичный Метод

public loadBinaryFile ( $binaryFileId )

loadBinaryFileByUri() публичный Метод

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

newBinaryCreateStructFromLocalFile() публичный Метод

public newBinaryCreateStructFromLocalFile ( $localFile )

newBinaryCreateStructFromUploadedFile() публичный Метод

public newBinaryCreateStructFromUploadedFile ( array $uploadedFile )
$uploadedFile array

setPrefix() публичный Метод

Sets the IOService prefix.
public setPrefix ( $prefix )