interface MulticolumnTextExportableAttributeInterface (View source)

Attribute controllers should implement this interface if they support importing/exporting to/from multiple plain text fields.

For simple data see SimpleTextExportableAttributeInterface

Methods

string[]
getAttributeTextRepresentationHeaders()

Get the handles of the columns that will contain parts of attribute values.

string[]
getAttributeValueTextRepresentation()

Get the strings containing the text representation of the attribute value currently set in the controller.

updateAttributeValueFromTextRepresentation(array $textRepresentation, ErrorList $warnings)

Update or create the attribute value starting from its text representation.

Details

string[] getAttributeTextRepresentationHeaders()

Get the handles of the columns that will contain parts of attribute values.

The result must be independent of the specific attribute value instance.

Return Value

string[]

Examples

An address attribute could return ['street', 'city', 'state', 'country']

string[] getAttributeValueTextRepresentation()

Get the strings containing the text representation of the attribute value currently set in the controller.

Return Value

string[]

Examples

An address attribute could return ['10 Downing Street', 'London', '', 'GB']

AbstractValue|null updateAttributeValueFromTextRepresentation(array $textRepresentation, ErrorList $warnings)

Update or create the attribute value starting from its text representation.

Parameters

array $textRepresentation

the text representation strings of the attribute value

ErrorList $warnings

An ErrorList instance that the method can add decoding warnings to

Return Value

AbstractValue|null

Returns NULL if the controller doesn't have already a value and $textRepresentation is empty

Examples

In case of an address attribute, this may update an address attribute value with its parts extracted from $textRepresentation.
The method could add to the $warnings instance a message if the Country code is not valid.
The method returns NULL if there wasn't an attribute value and $textRepresentation contains only empty strings.