3 namespace Drupal\Core\Config\Schema;
6 * Defines a configuration element of type Sequence.
8 * This object may contain any number and type of nested elements that share
9 * a common definition in the 'sequence' property of the configuration schema.
11 * Read https://www.drupal.org/node/1905070 for more details about configuration
12 * schema, types and type resolution.
14 * Note that sequences implement the typed data ComplexDataInterface (via the
15 * parent ArrayElement) rather than the ListInterface. This is because sequences
16 * may have named keys, which is not supported by ListInterface. From the typed
17 * data API perspective sequences are handled as ordered mappings without
18 * metadata about existing properties.
20 class Sequence extends ArrayElement {
25 protected function getElementDefinition($key) {
26 $value = isset($this->value[$key]) ? $this->value[$key] : NULL;
27 // @todo: Remove BC layer for sequence with hyphen in front. https://www.drupal.org/node/2444979
29 if (isset($this->definition['sequence'][0])) {
30 $definition = $this->definition['sequence'][0];
32 elseif ($this->definition['sequence']) {
33 $definition = $this->definition['sequence'];
35 return $this->buildDataDefinition($definition, $value, $key);