Issue #2018323 by effulgentsia, yched: Make TypedData implement PluginInspectionInterface.
parent
9ee90ca16d
commit
94b0b70f93
core/lib/Drupal/Core/TypedData
|
@ -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 @@ abstract class TypedData implements TypedDataInterface {
|
|||
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().
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue