diff --git a/core/lib/Drupal/Core/TypedData/TypedData.php b/core/lib/Drupal/Core/TypedData/TypedData.php index 7ea33f062f28ecb5cea1745ae422934f8ff3edfc..62fb8d95cd58308fc536289a1e78cb36b9e31590 100644 --- a/core/lib/Drupal/Core/TypedData/TypedData.php +++ b/core/lib/Drupal/Core/TypedData/TypedData.php @@ -7,13 +7,15 @@ namespace Drupal\Core\TypedData; +use Drupal\Component\Plugin\PluginInspectionInterface; + /** * The abstract base class for typed data. * * Classes deriving from this base class have to declare $value * or override getValue() or setValue(). */ -abstract class TypedData implements TypedDataInterface { +abstract class TypedData implements TypedDataInterface, PluginInspectionInterface { /** * The data definition. @@ -63,6 +65,20 @@ public function getType() { return $this->definition['type']; } + /** + * {@inheritdoc} + */ + public function getPluginId() { + return $this->definition['type']; + } + + /** + * {@inheritdoc} + */ + public function getPluginDefinition() { + return \Drupal::typedData()->getDefinition($this->definition['type']); + } + /** * Implements \Drupal\Core\TypedData\TypedDataInterface::getDefinition(). */