summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/TypedData/TypedData.php
diff options
context:
space:
mode:
authorAlex Pott2013-06-17 22:33:02 (GMT)
committerAlex Pott2013-06-17 22:33:02 (GMT)
commit94b0b70f93d4d0ecf72a79214f7dcac7800e5b37 (patch)
tree18d3f5b437f0ec5015c72f2d30e499cdadc2e36b /core/lib/Drupal/Core/TypedData/TypedData.php
parent9ee90ca16d4f444816db28b550e708b6c932d446 (diff)
Issue #2018323 by effulgentsia, yched: Make TypedData implement PluginInspectionInterface.
Diffstat (limited to 'core/lib/Drupal/Core/TypedData/TypedData.php')
-rw-r--r--core/lib/Drupal/Core/TypedData/TypedData.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/core/lib/Drupal/Core/TypedData/TypedData.php b/core/lib/Drupal/Core/TypedData/TypedData.php
index 7ea33f0..62fb8d9 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.
@@ -64,6 +66,20 @@ abstract class TypedData implements TypedDataInterface {
}
/**
+ * {@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().
*/
public function getDefinition() {