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

Creates a new field item list.

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

Parameters

\Drupal\Core\Entity\FieldableEntityInterface $entity: The entity this field item list will be part of.

string $field_name: The name of the field.

mixed $values: (optional) The data value. If set, it has to match one of the supported data type format as documented for the data type classes.

Return value

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

File

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

Class

FieldTypePluginManagerInterface
Defines an interface for the field type plugin manager.

Namespace

Drupal\Core\Field

Code

public function createFieldItemList(FieldableEntityInterface $entity, $field_name, $values = NULL);