eZPublishCommunityProject  2013.5
eZ\Publish\Core\IO\Handler\InMemory Class Reference

Backend interface for handling of binary files I/O in memory. More...

+ Inheritance diagram for eZ\Publish\Core\IO\Handler\InMemory:
+ Collaboration diagram for eZ\Publish\Core\IO\Handler\InMemory:

Public Member Functions

 __construct (array $storage=array())
 
 create (BinaryFileCreateStruct $createStruct)
 Creates and stores a new BinaryFile based on the BinaryFileCreateStruct $file. More...
 
 delete ($uri)
 Deletes the existing BinaryFile with path $uri. More...
 
 exists ($uri)
 Checks if the BinaryFile with path $path exists. More...
 
 getExternalPath ($path)
 Removes the internal storage path from $path. More...
 
 getFileContents ($uri)
 Returns the contents of the BinaryFile identified by $path. More...
 
 getFileResource ($uri)
 Returns a file resource to the BinaryFile identified by $uri. More...
 
 getInternalPath ($path)
 Returns the internal, handler level path for $path. More...
 
 getMetadata (MetadataHandler $metadataHandler, $path)
 Executes $metadataHandler on $path, and returns the metadata array. More...
 
 load ($uri)
 Loads the BinaryFile identified by $uri. More...
 
 update ($uri, BinaryFileUpdateStruct $updateFileStruct)
 Updates the file identified by $path with data from $updateFile. More...
 
- Public Member Functions inherited from eZ\Publish\Core\IO\Handler
 create (BinaryFileCreateStruct $createStruct)
 Creates and stores a new BinaryFile based on the BinaryFileCreateStruct $file. More...
 

Private Attributes

 $data
 
 $storage
 
 $storagePrefix = 'memory:'
 

Detailed Description

Backend interface for handling of binary files I/O in memory.

Constructor & Destructor Documentation

eZ\Publish\Core\IO\Handler\InMemory::__construct ( array  $storage = array())

Member Function Documentation

eZ\Publish\Core\IO\Handler\InMemory::create ( BinaryFileCreateStruct  $createStruct)

Creates and stores a new BinaryFile based on the BinaryFileCreateStruct $file.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the target path already exists
Parameters
BinaryFileCreateStruct$createStruct
Returns
BinaryFile The newly created BinaryFile object
eZ\Publish\Core\IO\Handler\InMemory::delete (   $uri)

Deletes the existing BinaryFile with path $uri.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf the file doesn't exist
Parameters
string$uri

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\InMemory::exists (   $uri)

Checks if the BinaryFile with path $path exists.

Parameters
string$path
Returns
boolean

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\InMemory::getExternalPath (   $path)

Removes the internal storage path from $path.

Parameters
string$path
Returns
string

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\InMemory::getFileContents (   $uri)

Returns the contents of the BinaryFile identified by $path.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif the file couldn't be found
Parameters
string$uri
Returns
string

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\InMemory::getFileResource (   $uri)

Returns a file resource to the BinaryFile identified by $uri.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf no file identified by $path exists
Parameters
string$uri
Returns
resource

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\InMemory::getInternalPath (   $path)

Returns the internal, handler level path for $path.

Parameters
string$path
Returns
string

Implements eZ\Publish\Core\IO\Handler.

Referenced by eZ\Publish\Core\IO\Handler\InMemory\getMetadata().

eZ\Publish\Core\IO\Handler\InMemory::getMetadata ( MetadataHandler  $metadataHandler,
  $path 
)

Executes $metadataHandler on $path, and returns the metadata array.

Parameters
MetadataHandler$metadataHandler
string$path
Returns
array

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\InMemory::load (   $uri)

Loads the BinaryFile identified by $uri.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf no file identified by $path exists
Parameters
string$uri
Returns

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\InMemory::update (   $uri,
BinaryFileUpdateStruct  $updateFileStruct 
)

Updates the file identified by $path with data from $updateFile.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf the source path doesn't exist
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the target path already exists
Parameters
string$path
\eZ\Publish\Core\IO\Values\BinaryFileUpdateStruct$updateFileStruct
Returns
The updated BinaryFile

Implements eZ\Publish\Core\IO\Handler.

Member Data Documentation

eZ\Publish\Core\IO\Handler\InMemory::$data
private
eZ\Publish\Core\IO\Handler\InMemory::$storage
private
eZ\Publish\Core\IO\Handler\InMemory::$storagePrefix = 'memory:'
private

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