FieldStorage
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¶
deleteFieldData()
¶
Deletes field data for all $fieldIds in the version identified by $versionInfo.
|
|
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
getFieldData()
¶
Populates $field value property based on the external data.
|
|
$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. |
getIndexData()
¶
Get index data for external data for search backend.
|
|
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
hasFieldData()
¶
Checks if field type has external data to deal with.
|
|
Return values
bool
storeFieldData()
¶
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 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