function ArrayElement::createElement

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/Schema/ArrayElement.php \Drupal\Core\Config\Schema\ArrayElement::createElement()
  2. 8.9.x core/lib/Drupal/Core/Config/Schema/ArrayElement.php \Drupal\Core\Config\Schema\ArrayElement::createElement()
  3. 11.x core/lib/Drupal/Core/Config/Schema/ArrayElement.php \Drupal\Core\Config\Schema\ArrayElement::createElement()

Creates a contained typed configuration object.

Parameters

\Drupal\Core\TypedData\DataDefinitionInterface $definition: The data definition object.

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

string $key: The key of the contained element.

Return value

\Drupal\Core\TypedData\TypedDataInterface

1 call to ArrayElement::createElement()
ArrayElement::parse in core/lib/Drupal/Core/Config/Schema/ArrayElement.php
Builds an array of contained elements.

File

core/lib/Drupal/Core/Config/Schema/ArrayElement.php, line 154

Class

ArrayElement
Defines a generic configuration element that contains multiple properties.

Namespace

Drupal\Core\Config\Schema

Code

protected function createElement($definition, $value, $key) {
    return $this->getTypedDataManager()
        ->create($definition, $value, $key, $this);
}

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