diff --git a/core/lib/Drupal/Core/Config/Schema/ArrayElement.php b/core/lib/Drupal/Core/Config/Schema/ArrayElement.php index 7fc6cc5153..768d993349 100644 --- a/core/lib/Drupal/Core/Config/Schema/ArrayElement.php +++ b/core/lib/Drupal/Core/Config/Schema/ArrayElement.php @@ -78,6 +78,14 @@ public function get($name) { /** * {@inheritdoc} */ + public function set($name, $value) { + $this->get($name)->setValue($value); + return $this; + } + + /** + * {@inheritdoc} + */ public function getElements() { if (!isset($this->elements)) { $this->elements = $this->parse(); diff --git a/core/lib/Drupal/Core/Config/Schema/TypedConfigInterface.php b/core/lib/Drupal/Core/Config/Schema/TypedConfigInterface.php index 740fde1fc6..73db292089 100644 --- a/core/lib/Drupal/Core/Config/Schema/TypedConfigInterface.php +++ b/core/lib/Drupal/Core/Config/Schema/TypedConfigInterface.php @@ -2,7 +2,7 @@ namespace Drupal\Core\Config\Schema; -use Drupal\Core\TypedData\TraversableTypedDataInterface; +use Drupal\Core\TypedData\DataContainerInterface; /** * Interface for a typed configuration object that contains multiple elements. @@ -14,7 +14,7 @@ * When implementing this interface which extends Traversable, make sure to list * IteratorAggregate or Iterator before this interface in the implements clause. */ -interface TypedConfigInterface extends TraversableTypedDataInterface { +interface TypedConfigInterface extends DataContainerInterface { /** * Determines whether the data structure is empty. diff --git a/core/lib/Drupal/Core/Config/TypedConfigManagerInterface.php b/core/lib/Drupal/Core/Config/TypedConfigManagerInterface.php index 5beeb6f1cd..188b648b2d 100644 --- a/core/lib/Drupal/Core/Config/TypedConfigManagerInterface.php +++ b/core/lib/Drupal/Core/Config/TypedConfigManagerInterface.php @@ -20,7 +20,7 @@ * @param string $name * Configuration object name. * - * @return \Drupal\Core\TypedData\TraversableTypedDataInterface + * @return \Drupal\Core\TypedData\DataContainerInterface * Typed configuration element. */ public function get($name); diff --git a/core/lib/Drupal/Core/TypedData/ComplexDataInterface.php b/core/lib/Drupal/Core/TypedData/ComplexDataInterface.php index 6396cb8f51..12c4c8f18f 100644 --- a/core/lib/Drupal/Core/TypedData/ComplexDataInterface.php +++ b/core/lib/Drupal/Core/TypedData/ComplexDataInterface.php @@ -18,7 +18,7 @@ * * @ingroup typed_data */ -interface ComplexDataInterface extends TraversableTypedDataInterface { +interface ComplexDataInterface extends DataContainerInterface { /** * Gets the data definition. @@ -94,12 +94,4 @@ public function getProperties($include_computed = FALSE); */ public function toArray(); - /** - * Determines whether the data structure is empty. - * - * @return bool - * TRUE if the data structure is empty, FALSE otherwise. - */ - public function isEmpty(); - } diff --git a/core/lib/Drupal/Core/TypedData/DataContainerInterface.php b/core/lib/Drupal/Core/TypedData/DataContainerInterface.php new file mode 100644 index 0000000000..00c91b9792 --- /dev/null +++ b/core/lib/Drupal/Core/TypedData/DataContainerInterface.php @@ -0,0 +1,76 @@ +