function ListDataDefinition::create

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/TypedData/ListDataDefinition.php \Drupal\Core\TypedData\ListDataDefinition::create()
  2. 10 core/lib/Drupal/Core/TypedData/ListDataDefinition.php \Drupal\Core\TypedData\ListDataDefinition::create()
  3. 11.x core/lib/Drupal/Core/TypedData/ListDataDefinition.php \Drupal\Core\TypedData\ListDataDefinition::create()

Creates a new list definition.

Parameters

string $item_type: The data type of the list items; e.g., 'string', 'integer' or 'any'.

Return value

static A new List Data Definition object.

Overrides DataDefinition::create

3 calls to ListDataDefinition::create()
TypedDataDefinitionTest::testLists in core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php
Tests deriving metadata about list items.
TypedDataTest::testTypedDataLists in core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
Tests using typed data lists.
TypedDataTest::testTypedDataListsFilter in core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
Tests the filter() method on typed data lists.
1 method overrides ListDataDefinition::create()
BaseFieldDefinition::create in core/lib/Drupal/Core/Field/BaseFieldDefinition.php
Creates a new field definition.

File

core/lib/Drupal/Core/TypedData/ListDataDefinition.php, line 26

Class

ListDataDefinition
A typed data definition class for defining lists.

Namespace

Drupal\Core\TypedData

Code

public static function create($item_type) {
    return static::createFromItemType($item_type);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.