diff --git a/core/lib/Drupal/Core/TypedData/TypedDataInterface.php b/core/lib/Drupal/Core/TypedData/TypedDataInterface.php index 0d1099acad..a100a850f4 100644 --- a/core/lib/Drupal/Core/TypedData/TypedDataInterface.php +++ b/core/lib/Drupal/Core/TypedData/TypedDataInterface.php @@ -42,6 +42,14 @@ public function getDataDefinition(); /** * Gets the data value. * + * Usually, the most convenient way to get a value is not to use this but + * instead use ->value. These two lines do the same thing: + * + * @code + * $value = $entity->get('field_key')->getValue()[0]['value'] ?? NULL; + * $value = $entity->get('field_key')->value; + * @endcode + * * @return mixed * The data value. */