eZPublishCommunityProject  2012.12
eZ\Publish\Core\FieldType\User\UserStorage Class Reference

Description of UserStorage. More...

+ Inheritance diagram for eZ\Publish\Core\FieldType\User\UserStorage:
+ Collaboration diagram for eZ\Publish\Core\FieldType\User\UserStorage:

Public Member Functions

 deleteFieldData (VersionInfo $versionInfo, array $fieldIds, array $context)
 
 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)
 Construct from gateways. More...
 
 addGateway ($identifier, StorageGateway $gateway)
 Adds a storage $gateway assigned to the given $identifier. More...
 

Additional Inherited Members

- 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 inherited from eZ\Publish\Core\FieldType\GatewayBasedStorage
 $gateways
 

Detailed Description

Description of UserStorage.

Methods in this interface are called by storage engine.

$context array passed to most methods 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.htmlezcDatabaseusageTheUserstoragehandlesthefollowingattributes,followingtheuserfieldtypeineZPublish4:-account_key-has_stored_login-is_enabled-is_locked-last_visit-login_count

Member Function Documentation

eZ\Publish\Core\FieldType\User\UserStorage::deleteFieldData ( VersionInfo  $versionInfo,
array  $fieldIds,
array  $context 
)
Parameters
VersionInfo$versionInfo
array$fieldIdsArray of field Ids
array$context
Returns
boolean

Implements eZ\Publish\SPI\FieldType\FieldStorage.

eZ\Publish\Core\FieldType\User\UserStorage::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\Field$field
array$context
Returns
void

Implements eZ\Publish\SPI\FieldType\FieldStorage.

eZ\Publish\Core\FieldType\User\UserStorage::getIndexData ( VersionInfo  $versionInfo,
Field  $field,
array  $context 
)
Parameters
\eZ\Publish\SPI\Persistence\Content\Field$field
array$context

Implements eZ\Publish\SPI\FieldType\FieldStorage.

eZ\Publish\Core\FieldType\User\UserStorage::hasFieldData ( )

Checks if field type has external data to deal with.

Returns
boolean

Implements eZ\Publish\SPI\FieldType\FieldStorage.

eZ\Publish\Core\FieldType\User\UserStorage::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),tobeusedaccordinglytoThecontextarrayprovidessomecontextforthefieldhandleraboutthecurrentlyusedstorageengine.Thearrayshouldatleastdefine2keys:-identifier(connectionidentifier)-connection(theconnectionhandler)Forexample,usingLegacystorageengine,$contextwillbe:-identifier='LegacyStorage'-connection=@link\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\Field$field@paramarray$context@returnnull|true

Implements eZ\Publish\SPI\FieldType\FieldStorage.


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