class InternalPropertyTestFieldItem extends StringItem
{ /**
* {@inheritdoc}
*/
public static function propertyDefinitions(FieldStorageDefinitionInterface
$field_definition) { $properties = parent::
propertyDefinitions($field_definition);
// Add a computed property that is non-internal.
$properties['non_internal_value'
] = DataDefinition::
create('string'
) ->
setLabel(new TranslatableMarkup('Computed string, non-internal property'
)) ->
setComputed(TRUE
) ->
setClass(ComputedString::
class) ->
setInternal(FALSE
);
// Add a computed property that is internal.
$properties['internal_value'
] = DataDefinition::
create('string'
) ->
setLabel(new TranslatableMarkup('Computed string, internal property'
)) ->
setComputed(TRUE
)