Sequence::getElementDefinition

protected Sequence::getElementDefinition($key)

Gets data definition object for contained element.

Parameters

int|string $key: Property name or index of the element.

Return value

\Drupal\Core\TypedData\DataDefinitionInterface

Overrides ArrayElement::getElementDefinition

File

core/lib/Drupal/Core/Config/Schema/Sequence.php, line 19

Class

Sequence
Defines a configuration element of type Sequence.

Namespace

Drupal\Core\Config\Schema

Code

protected function getElementDefinition($key) {
  $value = isset($this->value[$key]) ? $this->value[$key] : NULL;
  // @todo: Remove BC layer for sequence with hyphen in front. https://www.drupal.org/node/2444979
  $definition = array();
  if (isset($this->definition['sequence'][0])) {
    $definition = $this->definition['sequence'][0];
  }
  elseif ($this->definition['sequence']) {
    $definition = $this->definition['sequence'];
  }
  return $this->buildDataDefinition($definition, $value, $key);
}
doc_Drupal
2016-10-29 09:41:53
Comments
Leave a Comment

Please login to continue.