trait SerializedColumnNormalizerTrait (View source)

A trait providing methods for serialized columns.

Methods

checkForSerializedStrings(mixed $data, string $class, FieldItemInterface $field_item)

Checks if there is a serialized string for a column.

bool
dataHasStringForSerializeColumn(FieldItemInterface $field_item, array $data)

Checks if the data contains string value for serialize column.

string[]
getSerializedPropertyNames(FieldItemInterface $field_item)

Gets the names of all serialized properties.

string[]
getCustomSerializedPropertyNames(FieldItemInterface $field_item)

Gets the names of all properties the plugin treats as serialized data.

Details

protected checkForSerializedStrings(mixed $data, string $class, FieldItemInterface $field_item)

Checks if there is a serialized string for a column.

Parameters

mixed $data

The field item data to denormalize.

string $class

The expected class to instantiate.

FieldItemInterface $field_item

The field item.

protected bool dataHasStringForSerializeColumn(FieldItemInterface $field_item, array $data)

Checks if the data contains string value for serialize column.

Parameters

FieldItemInterface $field_item

The field item.

array $data

The data being denormalized.

Return Value

bool

TRUE if there is a string value for serialize column, otherwise FALSE.

protected string[] getSerializedPropertyNames(FieldItemInterface $field_item)

Gets the names of all serialized properties.

Parameters

FieldItemInterface $field_item

The field item.

Return Value

string[]

The property names for serialized properties.

protected string[] getCustomSerializedPropertyNames(FieldItemInterface $field_item)

Gets the names of all properties the plugin treats as serialized data.

This allows the field storage definition or entity type to provide a setting for serialized properties. This can be used for fields that handle serialized data themselves and do not rely on the serialized schema flag.

Parameters

FieldItemInterface $field_item

The field item.

Return Value

string[]

The property names for serialized properties.