eZPublishCommunityProject  2012.12
eZ\Publish\Core\FieldType\FileService Interface Reference
+ Inheritance diagram for eZ\Publish\Core\FieldType\FileService:

Public Member Functions

 exists ($storageIdentifier)
 Returns is a file/directory with the given $storageIdentifier exists. More...
 
 getFileSize ($storageIdentifier)
 Returns the file size of the file identified by $storageIdentifier. More...
 
 getMetaData ($storageIdentifier)
 Returns a hash of meta data for $storageIdentifier. More...
 
 getStorageIdentifier ($path)
 Returns a storage identifier for the given $path. More...
 
 remove ($storageIdentifier, $recursive=false)
 Removes the path identified by $storageIdentifier, potentially $recursive. More...
 
 storeFile ($sourcePath, $storageIdentifier)
 Store the local file identified by $sourcePath in a location that corresponds to $storageIdentifier. More...
 

Member Function Documentation

eZ\Publish\Core\FieldType\FileService::exists (   $storageIdentifier)

Returns is a file/directory with the given $storageIdentifier exists.

Parameters
string$storageIdentifier
Returns
boolean

Implemented in eZ\Publish\Core\FieldType\FileService\LocalFileService.

eZ\Publish\Core\FieldType\FileService::getFileSize (   $storageIdentifier)

Returns the file size of the file identified by $storageIdentifier.

Parameters
string$storageIdentifier
Returns
int

Implemented in eZ\Publish\Core\FieldType\FileService\LocalFileService.

eZ\Publish\Core\FieldType\FileService::getMetaData (   $storageIdentifier)

Returns a hash of meta data for $storageIdentifier.

array( 'width' => <int>, 'height' => <int>, 'mime' => <string>, );

Parameters
string$storageIdentifier
Returns
array
Todo:
This method should be extracted later into a dedicated class to handle meta data.

Implemented in eZ\Publish\Core\FieldType\FileService\LocalFileService.

eZ\Publish\Core\FieldType\FileService::getStorageIdentifier (   $path)

Returns a storage identifier for the given $path.

The storage identifier is used to identify $path inside the storage encapsulated by the file service.

Parameters
string$path
Returns
string

Implemented in eZ\Publish\Core\FieldType\FileService\LocalFileService.

eZ\Publish\Core\FieldType\FileService::remove (   $storageIdentifier,
  $recursive = false 
)

Removes the path identified by $storageIdentifier, potentially $recursive.

Attempts to removed the path identified by $storageIdentifier. If $storageIdentifier is a directory which is not empty and $recursive is set to false, an exception is thrown. Attempting to remove a non existing $storageIdentifier is silently ignored.

Parameters
string$storageIdentifier
boolean$recursive
Returns
void
Exceptions
\RuntimeExceptionif children of $storageIdentifier exist and $recursive is false
\RuntimeExceptionif $storageIdentifier could not be removed (most likely permission issues)

Implemented in eZ\Publish\Core\FieldType\FileService\LocalFileService.

eZ\Publish\Core\FieldType\FileService::storeFile (   $sourcePath,
  $storageIdentifier 
)

Store the local file identified by $sourcePath in a location that corresponds to $storageIdentifier.

Returns a storage identifier used inside the storage (might differ from the incoming $storageIdentifier).

Parameters
string$sourcePath
string$storageIdentifier
Returns
string

Implemented in eZ\Publish\Core\FieldType\FileService\LocalFileService.


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