eZPublishCommunityProject  2013.5
eZ\Publish\SPI\FieldType\FieldStorage Interface Reference
+ Inheritance diagram for eZ\Publish\SPI\FieldType\FieldStorage:

Public Member Functions

 deleteFieldData (VersionInfo $versionInfo, array $fieldIds, array $context)
 Deletes field data for all $fieldIds in the version identified by $versionInfo. 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)
 Get index data for external data for search backend. More...
 
 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...
 

Member Function Documentation

eZ\Publish\SPI\FieldType\FieldStorage::deleteFieldData ( VersionInfo  $versionInfo,
array  $fieldIds,
array  $context 
)

Deletes field data for all $fieldIds in the version identified by $versionInfo.

Parameters
\eZ\Publish\SPI\Persistence\Content\VersionInfo$versionInfo
array$fieldIdsArray of field IDs
array$context
Returns
boolean

Implemented in eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage, eZ\Publish\Core\FieldType\User\UserStorage, eZ\Publish\Core\FieldType\Keyword\KeywordStorage, eZ\Publish\Core\FieldType\Url\UrlStorage, eZ\Publish\Core\FieldType\MapLocation\MapLocationStorage, eZ\Publish\Core\FieldType\NullStorage, and eZ\Publish\Core\FieldType\XmlText\XmlTextStorage.

eZ\Publish\SPI\FieldType\FieldStorage::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

Implemented in eZ\Publish\Core\FieldType\Image\ImageStorage, eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage, eZ\Publish\Core\FieldType\User\UserStorage, eZ\Publish\Core\FieldType\Keyword\KeywordStorage, eZ\Publish\Core\FieldType\Url\UrlStorage, eZ\Publish\Core\FieldType\MapLocation\MapLocationStorage, eZ\Publish\Core\FieldType\XmlText\XmlTextStorage, and eZ\Publish\Core\FieldType\NullStorage.

eZ\Publish\SPI\FieldType\FieldStorage::getIndexData ( VersionInfo  $versionInfo,
Field  $field,
array  $context 
)
eZ\Publish\SPI\FieldType\FieldStorage::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 object 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.htmlezcDatabaseusageThismethodmightreturntrueif$fieldneedstobeupdatedafterstoragedonehere(tostoreaPKforinstance).Inanyothercase,thismethodmustnotreturnanything(null).@param\eZ\Publish\SPI\Persistence\Content\VersionInfo$versionInfo@param\eZ\Publish\SPI\Persistence\Content\Field$field@paramarray$context@returnmixednull|true

Implemented in eZ\Publish\Core\FieldType\Image\ImageStorage, eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage, eZ\Publish\Core\FieldType\User\UserStorage, eZ\Publish\Core\FieldType\Keyword\KeywordStorage, eZ\Publish\Core\FieldType\Url\UrlStorage, eZ\Publish\Core\FieldType\MapLocation\MapLocationStorage, eZ\Publish\Core\FieldType\NullStorage, and eZ\Publish\Core\FieldType\XmlText\XmlTextStorage.

Referenced by eZ\Publish\Core\FieldType\GatewayBasedStorage\copyLegacyField().


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