diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php index 6e55e5d..800538d 100644 --- a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php +++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php @@ -84,7 +84,8 @@ public function get($property_name) { throw new MissingDataException(String::format('Unable to get property @name as no entity has been provided.', array('@name' => $property_name))); } if (!$this->entity instanceof ContentEntityInterface) { - // @todo: Add support for config entities. + // @todo: Add support for config entities in + // https://www.drupal.org/node/1818574. throw new \InvalidArgumentException(String::format('Unable to get unknown property @name.', array('@name' => $property_name))); } // This will throw an exception for unknown fields. @@ -99,7 +100,8 @@ public function set($property_name, $value, $notify = TRUE) { throw new MissingDataException(String::format('Unable to set property @name as no entity has been provided.', array('@name' => $property_name))); } if (!$this->entity instanceof ContentEntityInterface) { - // @todo: Add support for config entities. + // @todo: Add support for config entities in + // https://www.drupal.org/node/1818574. throw new \InvalidArgumentException(String::format('Unable to set unknown property @name.', array('@name' => $property_name))); } // This will throw an exception for unknown fields. @@ -114,7 +116,8 @@ public function getProperties($include_computed = FALSE) { throw new MissingDataException(String::format('Unable to get properties as no entity has been provided.')); } if (!$this->entity instanceof ContentEntityInterface) { - // @todo: Add support for config entities. + // @todo: Add support for config entities in + // https://www.drupal.org/node/1818574. return array(); } return $this->entity->getFields($include_computed); @@ -176,6 +179,7 @@ public function applyDefaultValue($notify = TRUE) { * {@inheritdoc} */ public function getIterator() { + return new \ArrayIterator($this->getProperties()); return isset($this->entity) ? $this->entity->getIterator() : new \ArrayIterator([]); }