FieldItemDataDefinition::create

public static FieldItemDataDefinition::create($field_definition)

Creates a new field item definition.

Parameters

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition the item definition belongs to.

Return value

static

Overrides DataDefinition::create

File

core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php, line 48

Class

FieldItemDataDefinition
A typed data definition class for defining field items.

Namespace

Drupal\Core\Field\TypedData

Code

public static function create($field_definition) {
  $definition['type'] = 'field_item:' . $field_definition->getType();
  $item_definition = new static($definition);
  $item_definition->fieldDefinition = $field_definition;
  return $item_definition;
}
doc_Drupal
2016-10-29 09:11:42
Comments
Leave a Comment

Please login to continue.