Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Config / Schema / Sequence.php
1 <?php
2
3 namespace Drupal\Core\Config\Schema;
4
5 /**
6  * Defines a configuration element of type Sequence.
7  *
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.
10  *
11  * Read https://www.drupal.org/node/1905070 for more details about configuration
12  * schema, types and type resolution.
13  */
14 class Sequence extends ArrayElement {
15
16   /**
17    * {@inheritdoc}
18    */
19   protected function getElementDefinition($key) {
20     $value = isset($this->value[$key]) ? $this->value[$key] : NULL;
21     // @todo: Remove BC layer for sequence with hyphen in front. https://www.drupal.org/node/2444979
22     $definition = [];
23     if (isset($this->definition['sequence'][0])) {
24       $definition = $this->definition['sequence'][0];
25     }
26     elseif ($this->definition['sequence']) {
27       $definition = $this->definition['sequence'];
28     }
29     return $this->buildDataDefinition($definition, $value, $key);
30   }
31
32 }