Patched to Drupal 8.4.8 level. See https://www.drupal.org/sa-core-2018-004 and patch...
[yaffs-website] / web / core / lib / Drupal / Core / Config / Schema / Mapping.php
1 <?php
2
3 namespace Drupal\Core\Config\Schema;
4
5 /**
6  * Defines a mapping configuration element.
7  *
8  * This object may contain any number and type of nested properties and each
9  * property key may have its own definition in the 'mapping' property of the
10  * configuration schema.
11  *
12  * Properties in the configuration value that are not defined in the mapping
13  * will get the 'undefined' data type.
14  *
15  * Read https://www.drupal.org/node/1905070 for more details about configuration
16  * schema, types and type resolution.
17  */
18 class Mapping extends ArrayElement {
19
20   /**
21    * {@inheritdoc}
22    */
23   protected function getElementDefinition($key) {
24     $value = isset($this->value[$key]) ? $this->value[$key] : NULL;
25     $definition = isset($this->definition['mapping'][$key]) ? $this->definition['mapping'][$key] : [];
26     return $this->buildDataDefinition($definition, $value, $key);
27   }
28
29 }