Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / Config / Schema / ArrayElement.php
index c5076554475dd4a79933ac399207b31d34b7be42..b16cee0aeaaa560d98b5621045931c86373baf04 100644 (file)
@@ -2,10 +2,12 @@
 
 namespace Drupal\Core\Config\Schema;
 
+use Drupal\Core\TypedData\ComplexDataInterface;
+
 /**
  * Defines a generic configuration element that contains multiple properties.
  */
-abstract class ArrayElement extends Element implements \IteratorAggregate, TypedConfigInterface {
+abstract class ArrayElement extends Element implements \IteratorAggregate, TypedConfigInterface, ComplexDataInterface {
 
   /**
    * Parsed elements.
@@ -46,7 +48,7 @@ abstract class ArrayElement extends Element implements \IteratorAggregate, Typed
    *
    * @return \Drupal\Core\TypedData\DataDefinitionInterface
    */
-  protected abstract function getElementDefinition($key);
+  abstract protected function getElementDefinition($key);
 
   /**
    * {@inheritdoc}
@@ -161,4 +163,25 @@ abstract class ArrayElement extends Element implements \IteratorAggregate, Typed
     return isset($this->definition['nullable']) && $this->definition['nullable'] == TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function set($property_name, $value, $notify = TRUE) {
+    $this->value[$property_name] = $value;
+    // Config schema elements do not make use of notifications. Thus, we skip
+    // notifying parents.
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getProperties($include_computed = FALSE) {
+    $properties = [];
+    foreach (array_keys($this->value) as $name) {
+      $properties[$name] = $this->get($name);
+    }
+    return $properties;
+  }
+
 }