Skip to content
Snippets Groups Projects

Fixes #3420987 Convert DataType plugin discovery to attributes

Closed Kim Pepper requested to merge issue/drupal-3420987:3420987-convert-datatype-plugin into 11.x
26 files
+ 255
135
Compare changes
  • Side-by-side
  • Inline
Files
26
@@ -4,7 +4,10 @@
@@ -4,7 +4,10 @@
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityInterface;
 
use Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver;
use Drupal\Core\Entity\TypedData\EntityDataDefinition;
use Drupal\Core\Entity\TypedData\EntityDataDefinition;
 
use Drupal\Core\StringTranslation\TranslatableMarkup;
 
use Drupal\Core\TypedData\Attribute\DataType;
use Drupal\Core\TypedData\ComplexDataInterface;
use Drupal\Core\TypedData\ComplexDataInterface;
use Drupal\Core\TypedData\Exception\MissingDataException;
use Drupal\Core\TypedData\Exception\MissingDataException;
use Drupal\Core\TypedData\TypedData;
use Drupal\Core\TypedData\TypedData;
@@ -17,15 +20,14 @@
@@ -17,15 +20,14 @@
*
*
* In addition to the "entity" data type, this exposes derived
* In addition to the "entity" data type, this exposes derived
* "entity:$entity_type" and "entity:$entity_type:$bundle" data types.
* "entity:$entity_type" and "entity:$entity_type:$bundle" data types.
*
* @DataType(
* id = "entity",
* label = @Translation("Entity"),
* description = @Translation("All kind of entities, e.g. nodes, comments or users."),
* deriver = "\Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver",
* definition_class = "\Drupal\Core\Entity\TypedData\EntityDataDefinition"
* )
*/
*/
 
#[DataType(
 
id: "entity",
 
label: new TranslatableMarkup("Entity"),
 
description: new TranslatableMarkup("All kind of entities, e.g. nodes, comments or users."),
 
definition_class: EntityDataDefinition::class,
 
deriver: EntityDeriver::class
 
)]
class EntityAdapter extends TypedData implements \IteratorAggregate, ComplexDataInterface {
class EntityAdapter extends TypedData implements \IteratorAggregate, ComplexDataInterface {
/**
/**
Loading