Class

eZ\Publish\Core\FieldType\User\UserStorage

class UserStorage extends GatewayBasedStorage

Description of UserStorage.

Methods in this interface are called by storage engine. Proper Gateway and its Connection is injected via Dependency Injection.

The User storage handles the following attributes, following the user field type in eZ Publish 4: - accountkey - hasstoredlogin - isenabled - islocked - lastvisit - login_count

Methods

__construct(StorageGateway $gateway)

from GatewayBasedStorage
null|bool 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.

from GatewayBasedStorage
null|true storeFieldData(VersionInfo $versionInfo, Field $field, array $context)

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

getFieldData(VersionInfo $versionInfo, Field $field, array $context)

Populates $field value property based on the external data.

bool deleteFieldData(VersionInfo $versionInfo, array $fieldIds, array $context)

bool hasFieldData()

Checks if field type has external data to deal with.

Field[] getIndexData(VersionInfo $versionInfo, Field $field, array $context)

Details

in GatewayBasedStorage at line 29
public __construct(StorageGateway $gateway)

Parameters

StorageGateway $gateway

in GatewayBasedStorage at line 48
public null|bool 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.

By default the method falls back to the {@link \eZ\Publish\SPI\FieldType\FieldStorage::storeFieldData()}. External storages implement this method as needed.

Parameters

VersionInfo $versionInfo
Field $field
Field $originalField
array $context

Return Value

null|bool Same as {@link \eZ\Publish\SPI\FieldType\FieldStorage::storeFieldData()}.

at line 62
public null|true 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 {@link eZ\Publish\SPI\Persistence\Content\Field} object is passed and its value is accessible through the {@link eZ\Publish\SPI\Persistence\Content\FieldValue} 'value' property. This value holds the data filled by the user as a {@link eZ\Publish\Core\FieldType\Value} based object, according to the field type (e.g. for TextLine, it will be a {@link eZ\Publish\Core\FieldType\TextLine\Value} 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).

Database connection handler is injected into the Gateway via Dependency Injection.

This method might return true if $field needs to be updated after storage done here (to store a PK for instance). In any other case, this method must not return anything (null).

Parameters

VersionInfo $versionInfo
Field $field
array $context

Return Value

null|true null|true

at line 77
public getFieldData(VersionInfo $versionInfo, Field $field, array $context)

Populates $field value property based on the external data.

$field->value is a {@link eZ\Publish\SPI\Persistence\Content\FieldValue} object. This value holds the data as a {@link eZ\Publish\Core\FieldType\Value} based object, according to the field type (e.g. for TextLine, it will be a {@link eZ\Publish\Core\FieldType\TextLine\Value} object).

Parameters

VersionInfo $versionInfo
Field $field
array $context

at line 89
public bool deleteFieldData(VersionInfo $versionInfo, array $fieldIds, array $context)

Parameters

VersionInfo $versionInfo
array $fieldIds Array of field Ids
array $context

Return Value

bool

at line 99
public bool hasFieldData()

Checks if field type has external data to deal with.

Return Value

bool

at line 111
public Field[] getIndexData(VersionInfo $versionInfo, Field $field, array $context)

Parameters

VersionInfo $versionInfo
Field $field
array $context

Return Value

Field[]