diff --git a/core/lib/Drupal/Core/Entity/ContentEntityInterface.php b/core/lib/Drupal/Core/Entity/ContentEntityInterface.php index 3604879..fac4591 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityInterface.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityInterface.php @@ -7,7 +7,6 @@ namespace Drupal\Core\Entity; -use Drupal\Core\TypedData\ComplexDataInterface; use Drupal\Core\TypedData\TranslatableInterface; /** @@ -155,7 +154,7 @@ public function toArray(); /** * Gets a field item list. * - * @param $field_name + * @param string $field_name * The name of the field to get; e.g., 'title' or 'name'. * * @throws \InvalidArgumentException @@ -169,9 +168,9 @@ public function get($field_name); /** * Sets a field value. * - * @param $field_name - * The name of the property to set; e.g., 'title' or 'name'. - * @param $value + * @param string $field_name + * The name of the field to set; e.g., 'title' or 'name'. + * @param mixed $value * The value to set, or NULL to unset the field. * @param bool $notify * (optional) Whether to notify the entity of the change. Defaults to @@ -197,11 +196,11 @@ public function set($field_name, $value, $notify = TRUE); public function getFields($include_computed = FALSE); /** - * React to changes to a child field. + * Reacts to changes to a field. * * Note that this is invoked after any changes have been applied. * - * @param $field_name + * @param string $field_name * The name of the field which is changed. */ public function onChange($field_name); @@ -214,4 +213,5 @@ public function onChange($field_name); * succeeded. */ public function validate(); + } diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php index ce8f088..66bc7a7 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php @@ -8,11 +8,8 @@ namespace Drupal\Core\Entity; use Drupal\Component\Utility\String; -use Drupal\Core\Field\PrepareCacheInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldStorageDefinitionInterface; -use Drupal\Core\Cache\Cache; -use Drupal\field\FieldInstanceConfigInterface; use Symfony\Component\DependencyInjection\ContainerInterface; abstract class ContentEntityStorageBase extends EntityStorageBase implements FieldableEntityStorageInterface { diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index a1d161b..d99d336 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -560,8 +560,7 @@ public function toArray() { public function getTypedData() { if (!isset($this->typedData)) { $class = \Drupal::typedDataManager()->getDefinition('entity')['class']; - //$this->typedData = $class::createFromEntity($this); - return $class::createFromEntity($this); + $this->typedData = $class::createFromEntity($this); } return $this->typedData; } @@ -573,4 +572,5 @@ public function __sleep() { $this->typedData = NULL; return $this->traitSleep(); } + } diff --git a/core/lib/Drupal/Core/Entity/EntityInterface.php b/core/lib/Drupal/Core/Entity/EntityInterface.php index b026948..af55fd6 100644 --- a/core/lib/Drupal/Core/Entity/EntityInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityInterface.php @@ -359,10 +359,10 @@ public function setOriginalId($id); public function toArray(); /** - * Returns a typed data object for the entity object. + * Returns a typed data object for this entity object. * - * The returned typed data objects wraps the entity objects and allows dealing - * with entities based on the generic typed data API. + * The returned typed data object wraps this entity and allows dealing with + * entities based on the generic typed data API. * * @return \Drupal\Core\TypedData\ComplexDataInterface * The typed data object for this entity. diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/Entity.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/Entity.php index f199a4f..d4c7b69 100644 --- a/core/lib/Drupal/Core/Entity/Plugin/DataType/Entity.php +++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/Entity.php @@ -19,7 +19,7 @@ * Defines the "entity" data type. * * Instances of this class wrap entity objects and allow to deal with entities - * based upon the typed data API. + * based upon the Typed Data API. * In addition to the "entity" data type, there is derivative which exposes * "entity:$entity_type" and "entity:$entity_type:$bundle" data types. * diff --git a/core/lib/Drupal/Core/TypedData/TypedDataInterface.php b/core/lib/Drupal/Core/TypedData/TypedDataInterface.php index 17bed01..74d083f 100644 --- a/core/lib/Drupal/Core/TypedData/TypedDataInterface.php +++ b/core/lib/Drupal/Core/TypedData/TypedDataInterface.php @@ -23,7 +23,7 @@ * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * The data definition. - * @param string $name + * @param string|null $name * (optional) The name of the created property, or NULL if it is the root * of a typed data tree. Defaults to NULL. * @param \Drupal\Core\TypedData\TypedDataInterface $parent @@ -156,10 +156,10 @@ public function getPropertyPath(); * * This method is supposed to be called by the factory only. * - * @param string $name + * @param string|null $name * (optional) The name of the property or the delta of the list item, * or NULL if it is the root of a typed data tree. Defaults to NULL. - * @param \Drupal\Core\TypedData\TypedDataInterface $parent + * @param \Drupal\Core\TypedData\TypedDataInterface|null $parent * (optional) The parent object of the data property, or NULL if it is the * root of a typed data tree. Defaults to NULL. */