Same name in this branch
  1. 10 core/lib/Drupal/Component/Annotation/PluginID.php \Drupal\Component\Annotation\PluginID
  2. 10 core/lib/Drupal/Component/Plugin/Attribute/PluginID.php \Drupal\Component\Plugin\Attribute\PluginID
Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Component/Annotation/PluginID.php \Drupal\Component\Annotation\PluginID
  2. 9 core/lib/Drupal/Component/Annotation/PluginID.php \Drupal\Component\Annotation\PluginID

Defines a Plugin annotation object that just contains an ID.

Hierarchy

Expanded class hierarchy of PluginID

Related topics

4 files declare their use of PluginID
PluginIdTest.php in core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php
PluginManager.php in core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php
RenderElement.php in core/lib/Drupal/Core/Render/Annotation/RenderElement.php
ViewsHandlerAnnotationBase.php in core/modules/views/src/Annotation/ViewsHandlerAnnotationBase.php
2 classes are annotated with PluginID
NullIdMap in core/modules/migrate/src/Plugin/migrate/id_map/NullIdMap.php
Defines the null ID map implementation.
Sql in core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
Defines the sql based ID map implementation.

File

core/lib/Drupal/Component/Annotation/PluginID.php, line 10

Namespace

Drupal\Component\Annotation
View source
class PluginID extends AnnotationBase {

  /**
   * The plugin ID.
   *
   * When an annotation is given no key, 'value' is assumed by Doctrine.
   *
   * @var string
   */
  public $value;

  /**
   * {@inheritdoc}
   */
  public function get() {
    return [
      'id' => $this->value,
      'class' => $this->class,
      'provider' => $this->provider,
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getId() {
    return $this->value;
  }

}

Members

Namesort ascending Modifiers Type Description Overrides
PluginID::getId public function Gets the unique ID for this annotated class. Overrides AnnotationBase::getId
PluginID::get public function Gets the value of an annotation. Overrides AnnotationInterface::get
PluginID::$value public property The plugin ID.
AnnotationBase::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
AnnotationBase::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
AnnotationBase::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
AnnotationBase::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
AnnotationBase::$provider protected property The provider of the annotated class.
AnnotationBase::$id public property The annotated class ID. 1
AnnotationBase::$class protected property The class used for this annotated class.