You are here

public static function EntityBlockItem::propertyDefinitions in Entityblock 8

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/EntityBlockItem.php, line 43
Contains \Drupal\entityblock\Plugin\Field\FieldType\EntityBlockItem.

Class

EntityBlockItem
Plugin implementation of the 'EntityBlock' field type.

Namespace

Drupal\entityblock\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
  $properties['enabled'] = DataDefinition::create('boolean')
    ->setLabel(t('Enabled'));
  $properties['title'] = DataDefinition::create('string')
    ->setLabel(t('Title'));
  $properties['view_mode'] = DataDefinition::create('string')
    ->setLabel(t('View mode'));
  return $properties;
}