Interface for setting field type data.
Methods in this interface are called by storage engine.
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 |
Return values
bool
getDefaultFieldData()
¶
Populates <code>$field</code> value property with default data 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 | - | - |
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 | - | - |
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).
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 | - | - |
Return values
mixed
null|true