Copied!

FieldStorage

FieldStorage.php : 19

Interface for setting field type data.

Methods in this interface are called by storage engine.

$context array passed to most methods is deprecated and will be dropped in the next major version.

Methods

publicdeleteFieldData()

FieldStorage.php : 69

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

public deleteFieldData(VersionInfo $versionInfo, array<string|int, mixed> $fieldIds, array<string|int, mixed> $context) : bool

Parameters

Name Type Default value Description
$versionInfo VersionInfo - -
$fieldIds array<string|int, mixed> -

Array of field IDs

$context array<string|int, mixed> -

Deprecated. Rely on injected Connection instead.

Return values

bool

publicgetFieldData()

FieldStorage.php : 57

Populates $field value property based on the external data.

public getFieldData(VersionInfo $versionInfo, Field $field, array<string|int, mixed> $context) : mixed

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

Parameters

Name Type Default value Description
$versionInfo VersionInfo - -
$field Field - -
$context array<string|int, mixed> -

Deprecated. Rely on injected Connection instead.

publicgetIndexData()

FieldStorage.php : 89

Get index data for external data for search backend.

public getIndexData(VersionInfo $versionInfo, Field $field, array<string|int, mixed> $context) : array<string|int, Field>

Parameters

Name Type Default value Description
$versionInfo VersionInfo - -
$field Field - -
$context array<string|int, mixed> -

Deprecated. Rely on injected Connection instead.

Return values

array<string|int, Field>

Tags
Deprecated

Use Indexable

publichasFieldData()

FieldStorage.php : 76

Checks if field type has external data to deal with.

public hasFieldData() : bool

Return values

bool

publicstoreFieldData()

FieldStorage.php : 45

Allows custom field types to store data in an external source (e.g. another DB table).

public storeFieldData(VersionInfo $versionInfo, Field $field, array<string|int, mixed> $context) : mixed

Stores value for $field in an external data source. The whole Field object is passed and its value is accessible through the FieldValue 'value' property. This value holds the data filled by the user as a Value based object, according to the field type (e.g. for TextLine, it will be a 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).

The context array is deprecated and will be dropped in the next major version.

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

Name Type Default value Description
$versionInfo VersionInfo - -
$field Field - -
$context array<string|int, mixed> -

Deprecated. Rely on injected Connection instead.

Return values

mixed

null|true