eZPublishCommunityProject  2013.5
eZ\Publish\Core\IO\IOService Class Reference

Public Member Functions

 __construct (Handler $handler, MimeTypeDetector $mimeTypeDetector, array $settings=array())
 Setups service with reference to repository object that created it & corresponding handler. More...
 
 createBinaryFile (BinaryFileCreateStruct $binaryFileCreateStruct)
 Creates a binary file in the repository. More...
 
 deleteBinaryFile (BinaryFile $binaryFile)
 Deletes the BinaryFile with $path. More...
 
 getExternalPath ($internalPath)
 Returns the external path to $internalPath. More...
 
 getFileContents (BinaryFile $binaryFile)
 Returns the content of the binary file. More...
 
 getFileInputStream (BinaryFile $binaryFile)
 Returns a read (mode: rb) file resource to the binary file identified by $path. More...
 
 getInternalPath ($externalPath)
 Returns the internal, handler level path to $externalPath. More...
 
 getMetadata (MetadataHandler $metadataHandler, BinaryFile $binaryFile)
 
 loadBinaryFile ($uri)
 Loads the binary file with $id. More...
 
 newBinaryCreateStructFromLocalFile ($localFile)
 Creates a BinaryFileCreateStruct object from $localFile. More...
 
 newBinaryCreateStructFromUploadedFile (array $uploadedFile)
 Creates a BinaryFileCreateStruct object from the uploaded file $uploadedFile. More...
 

Protected Member Functions

 buildDomainBinaryFileObject (SPIBinaryFile $spiBinaryFile)
 Generates API BinaryFile object from provided SPI BinaryFile object. More...
 
 buildSPIBinaryFileCreateStructObject (BinaryFileCreateStruct $binaryFileCreateStruct)
 Generates SPI BinaryFileCreateStruct object from provided API BinaryFileCreateStruct object. More...
 
 getPrefixedUri ($uri)
 Returns $uri prefixed with what is configured in the service. More...
 
 removeUriPrefix ($uri)
 

Protected Attributes

 $ioHandler
 
 $mimeTypeDetector
 
 $settings
 

Constructor & Destructor Documentation

eZ\Publish\Core\IO\IOService::__construct ( Handler  $handler,
MimeTypeDetector  $mimeTypeDetector,
array  $settings = array() 
)

Setups service with reference to repository object that created it & corresponding handler.

Parameters
\eZ\Publish\Core\IO\Handler$handler
array$settings

Member Function Documentation

eZ\Publish\Core\IO\IOService::buildDomainBinaryFileObject ( SPIBinaryFile  $spiBinaryFile)
protected

Generates API BinaryFile object from provided SPI BinaryFile object.

Parameters
\eZ\Publish\SPI\IO\BinaryFile$spiBinaryFile
Returns

Referenced by eZ\Publish\Core\IO\IOService\createBinaryFile(), and eZ\Publish\Core\IO\IOService\loadBinaryFile().

eZ\Publish\Core\IO\IOService::buildSPIBinaryFileCreateStructObject ( BinaryFileCreateStruct  $binaryFileCreateStruct)
protected

Generates SPI BinaryFileCreateStruct object from provided API BinaryFileCreateStruct object.

Parameters
\eZ\Publish\Core\IO\Values\BinaryFileCreateStruct$binaryFileCreateStruct
Returns

Referenced by eZ\Publish\Core\IO\IOService\createBinaryFile().

eZ\Publish\Core\IO\IOService::createBinaryFile ( BinaryFileCreateStruct  $binaryFileCreateStruct)

Creates a binary file in the repository.

Parameters
\eZ\Publish\Core\IO\Values\BinaryFileCreateStruct$binaryFileCreateStruct
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentValue
Returns
The created BinaryFile object

Referenced by eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage\storeFieldData(), and eZ\Publish\Core\FieldType\Image\ImageStorage\storeFieldData().

eZ\Publish\Core\IO\IOService::deleteBinaryFile ( BinaryFile  $binaryFile)

Deletes the BinaryFile with $path.

Parameters
\eZ\Publish\Core\IO\Values\BinaryFile$binaryFile
Exceptions
InvalidArgumentValue

Referenced by eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage\deleteFieldData(), and eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage\removeOldFile().

eZ\Publish\Core\IO\IOService::getExternalPath (   $internalPath)

Returns the external path to $internalPath.

Parameters
string$internalPath
Returns
string

Referenced by eZ\Publish\Core\FieldType\Image\ImageStorage\getFieldData(), and eZ\Publish\Core\FieldType\Image\ImageStorage\storeFieldData().

eZ\Publish\Core\IO\IOService::getFileContents ( BinaryFile  $binaryFile)

Returns the content of the binary file.

Parameters
\eZ\Publish\Core\IO\Values\BinaryFile$binaryFile
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentValue
Returns
string
eZ\Publish\Core\IO\IOService::getFileInputStream ( BinaryFile  $binaryFile)

Returns a read (mode: rb) file resource to the binary file identified by $path.

Parameters
\eZ\Publish\Core\IO\Values\BinaryFile$binaryFile
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentValue
Returns
resource
eZ\Publish\Core\IO\IOService::getInternalPath (   $externalPath)

Returns the internal, handler level path to $externalPath.

Parameters
string$externalPath
Returns
string

Referenced by eZ\Publish\Core\FieldType\Image\ImageStorage\storeFieldData().

eZ\Publish\Core\IO\IOService::getMetadata ( MetadataHandler  $metadataHandler,
BinaryFile  $binaryFile 
)
Parameters
MetadataHandler$metadataHandler
BinaryFile$binaryFile
Returns
array
eZ\Publish\Core\IO\IOService::newBinaryCreateStructFromLocalFile (   $localFile)

Creates a BinaryFileCreateStruct object from $localFile.

Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentExceptionWhen given a non existing / unreadable file
Parameters
string$localFilePath to local file
Returns

Referenced by eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage\storeFieldData(), and eZ\Publish\Core\FieldType\Image\ImageStorage\storeFieldData().

eZ\Publish\Core\IO\IOService::newBinaryCreateStructFromUploadedFile ( array  $uploadedFile)

Creates a BinaryFileCreateStruct object from the uploaded file $uploadedFile.

Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentExceptionWhen given an invalid uploaded file
Parameters
array$uploadedFileThe $_POST hash of an uploaded file
Returns
eZ\Publish\Core\IO\IOService::removeUriPrefix (   $uri)
protected
Parameters
$uri
Returns
string
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentException

Referenced by eZ\Publish\Core\IO\IOService\getExternalPath().

Member Data Documentation

eZ\Publish\Core\IO\IOService::$ioHandler
protected
eZ\Publish\Core\IO\IOService::$mimeTypeDetector
protected
eZ\Publish\Core\IO\IOService::$settings
protected

The documentation for this class was generated from the following file: