You are here

public function FieldTypePluginManagerInterface::createFieldItem in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/FieldTypePluginManagerInterface.php \Drupal\Core\Field\FieldTypePluginManagerInterface::createFieldItem()
  2. 9 core/lib/Drupal/Core/Field/FieldTypePluginManagerInterface.php \Drupal\Core\Field\FieldTypePluginManagerInterface::createFieldItem()

Creates a new field item as part of a field item list.

The provided item list is assigned as the parent of the created item. It However, it is the responsibility of the caller (usually the parent list itself) to have the parent aware of the item as a new child.

Parameters

\Drupal\Core\Field\FieldItemListInterface $items: The field item list, for which to create a new item.

int $index: The list index at which the item is created.

array|null $values: (optional) The values to assign to the field item properties.

Return value

\Drupal\Core\Field\FieldItemInterface The instantiated object.

1 method overrides FieldTypePluginManagerInterface::createFieldItem()
FieldTypePluginManager::createFieldItem in core/lib/Drupal/Core/Field/FieldTypePluginManager.php
Creates a new field item as part of a field item list.

File

core/lib/Drupal/Core/Field/FieldTypePluginManagerInterface.php, line 53

Class

FieldTypePluginManagerInterface
Defines an interface for the field type plugin manager.

Namespace

Drupal\Core\Field

Code

public function createFieldItem(FieldItemListInterface $items, $index, $values = NULL);