eZPublishCommunityProject  2013.5
eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage Class Reference

Storage for binary files. More...

+ Inheritance diagram for eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage:
+ Collaboration diagram for eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage:

Public Member Functions

 __construct (array $gateways, IOService $IOService, PathGenerator $pathGenerator, MimeTypeDetector $mimeTypeDetector)
 Construct from gateways. More...
 
 copyLegacyField (VersionInfo $versionInfo, Field $field, Field $originalField, array $context)
 
 deleteFieldData (VersionInfo $versionInfo, array $fieldIds, array $context)
 Deletes all referenced external data. More...
 
 getFieldData (VersionInfo $versionInfo, Field $field, array $context)
 Populates $field value property based on the external data. More...
 
 getIndexData (VersionInfo $versionInfo, Field $field, array $context)
 
 hasFieldData ()
 Checks if field type has external data to deal with. More...
 
 storeFieldData (VersionInfo $versionInfo, Field $field, array $context)
 Allows custom field types to store data in an external source (e.g. More...
 
- Public Member Functions inherited from eZ\Publish\Core\FieldType\GatewayBasedStorage
 __construct (array $gateways=array())
 Construct from gateways. More...
 
 addGateway ($identifier, StorageGateway $gateway)
 Adds a storage $gateway assigned to the given $identifier. More...
 
 copyLegacyField (VersionInfo $versionInfo, Field $field, Field $originalField, array $context)
 This method is used exclusively by Legacy Storage to copy external data of existing field in main language to the untranslatable field not passed in create or update struct, but created implicitly in storage layer. More...
 

Protected Member Functions

 removeOldFile ($fieldId, $versionNo, array $context)
 Removes the old file referenced by $fieldId in $versionNo, if not referenced else where. More...
 
- Protected Member Functions inherited from eZ\Publish\Core\FieldType\GatewayBasedStorage
 getGateway (array $context)
 Retrieve the fitting gateway, base on the identifier in $context. More...
 

Protected Attributes

 $IOService
 
 $mimeTypeDetector
 
 $pathGenerator
 
- Protected Attributes inherited from eZ\Publish\Core\FieldType\GatewayBasedStorage
 $gateways
 

Detailed Description

Storage for binary files.

Constructor & Destructor Documentation

eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::__construct ( array  $gateways,
IOService  $IOService,
PathGenerator  $pathGenerator,
MimeTypeDetector  $mimeTypeDetector 
)

Construct from gateways.

Parameters
\eZ\Publish\Core\FieldType\StorageGateway[]$gateways
IOService$IOService
PathGenerator$pathGenerator

Member Function Documentation

eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::copyLegacyField ( VersionInfo  $versionInfo,
Field  $field,
Field  $originalField,
array  $context 
)
eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::deleteFieldData ( VersionInfo  $versionInfo,
array  $fieldIds,
array  $context 
)

Deletes all referenced external data.

Parameters
VersionInfo$versionInfo
array$fieldIds
array$context
Returns
boolean

Implements eZ\Publish\SPI\FieldType\FieldStorage.

eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::getFieldData ( VersionInfo  $versionInfo,
Field  $field,
array  $context 
)

Populates $field value property based on the external data.

$field->value is a eZ object. This value holds the data as a eZ based object, according to the field type (e.g. for TextLine, it will be a eZ object).

Parameters
\eZ\Publish\SPI\Persistence\Content\VersionInfo$versionInfo
\eZ\Publish\SPI\Persistence\Content\Field$field
array$context
Returns
void

Implements eZ\Publish\SPI\FieldType\FieldStorage.

eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::getIndexData ( VersionInfo  $versionInfo,
Field  $field,
array  $context 
)
Parameters
\eZ\Publish\SPI\Persistence\Content\VersionInfo$versionInfo
\eZ\Publish\SPI\Persistence\Content\Field$field
array$context
Returns
void

Implements eZ\Publish\SPI\FieldType\FieldStorage.

eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::hasFieldData ( )

Checks if field type has external data to deal with.

Returns
boolean

Implements eZ\Publish\SPI\FieldType\FieldStorage.

eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::removeOldFile (   $fieldId,
  $versionNo,
array  $context 
)
protected

Removes the old file referenced by $fieldId in $versionNo, if not referenced else where.

Parameters
mixed$fieldId
string$versionNo
array$context
Returns
void

Referenced by eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage\storeFieldData().

eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::storeFieldData ( VersionInfo  $versionInfo,
Field  $field,
array  $context 
)

Allows custom field types to store data in an external source (e.g.

another DB table).

Stores value for $field in an external data source. The whole eZ ValueObject is passed and its value is accessible through the eZ 'value' property. This value holds the data filled by the user as a eZ based object, according to the field type (e.g. for TextLine, it will be a eZ object).

$field->id = unique ID from the attribute tables (needs to be generated by database back end on create, before the external data source may be called from storing).

The context array provides some context for the field handler about the currently used storage engine. The array should at least define 2 keys :

  • identifier (connection identifier)
  • connection (the connection handler) For example, using Legacy storage engine, $context will be:
  • identifier = 'LegacyStorage'
  • connection = eZ\Publish\Core\Persistence\Legacy\EzcDbHandlerobjecthandler(forDBconnection),tobeusedaccordinglyto@linkhttp://incubator.apache.org/zetacomponents/documentation/trunk/Database/tutorial.htmlezcDatabaseusage@param\eZ\Publish\SPI\Persistence\Content\VersionInfo$versionInfo@param\eZ\Publish\SPI\Persistence\Content\Field$field@paramarray$context@returnvoid

Implements eZ\Publish\SPI\FieldType\FieldStorage.

Member Data Documentation

eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::$IOService
protected
eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::$mimeTypeDetector
protected
eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::$pathGenerator
protected

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