You are here

public static function BynderMetadataItem::propertyDefinitions in Bynder 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/Field/FieldType/BynderMetadataItem.php \Drupal\bynder\Plugin\Field\FieldType\BynderMetadataItem::propertyDefinitions()
  2. 8.2 src/Plugin/Field/FieldType/BynderMetadataItem.php \Drupal\bynder\Plugin\Field\FieldType\BynderMetadataItem::propertyDefinitions()

Defines field item properties.

Properties that are required to constitute a valid, non-empty item should be denoted with \Drupal\Core\TypedData\DataDefinition::setRequired().

Return value

\Drupal\Core\TypedData\DataDefinitionInterface[] An array of property definitions of contained properties, keyed by property name.

Overrides FieldItemInterface::propertyDefinitions

See also

\Drupal\Core\Field\BaseFieldDefinition

File

src/Plugin/Field/FieldType/BynderMetadataItem.php, line 32

Class

BynderMetadataItem
Plugin implementation of the 'bynder_metadata' field type.

Namespace

Drupal\bynder\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
  $properties['value'] = DataDefinition::create('string')
    ->setLabel(t('JSON Value'));
  return $properties;
}