function MapDataDefinition::create

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

Creates a new map definition.

Parameters

string $type: (optional) The data type of the map. Defaults to 'map'.

Return value

static

Overrides DataDefinition::create

3 calls to MapDataDefinition::create()
MapDataDefinition::createFromDataType in core/lib/Drupal/Core/TypedData/MapDataDefinition.php
Creates a new data definition object.
MapDataNormalizerTest::buildExampleTypedData in core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php
Builds some example typed data object with no properties.
RecursiveContextualValidatorTest::setupTypedData in core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
Setups a typed data object used for test purposes.

File

core/lib/Drupal/Core/TypedData/MapDataDefinition.php, line 25

Class

MapDataDefinition
A typed data definition class for defining maps.

Namespace

Drupal\Core\TypedData

Code

public static function create($type = 'map') {
    $definition['type'] = $type;
    return new static($definition);
}

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