You are here

protected function FieldFormatterEntityEmbedDisplayBase::createFieldDefinition in Entity Embed 8

Creates a new faux-field definition.

Parameters

string $type: The type of the field.

Return value

\Drupal\Core\Field\BaseFieldDefinition A new field definition.

File

src/EntityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php, line 230

Class

FieldFormatterEntityEmbedDisplayBase
Base class for field formatter display plugins.

Namespace

Drupal\entity_embed\EntityEmbedDisplay

Code

protected function createFieldDefinition($type) {
  $definition = BaseFieldDefinition::create($type);
  static $index = 0;
  $definition
    ->setName('_entity_embed_' . $index++);
  return $definition;
}