PluginID.php

Same filename in other branches
  1. 8.9.x core/lib/Drupal/Component/Annotation/PluginID.php
  2. 10 core/lib/Drupal/Component/Annotation/PluginID.php
  3. 10 core/lib/Drupal/Component/Plugin/Attribute/PluginID.php
  4. 11.x core/lib/Drupal/Component/Annotation/PluginID.php
  5. 11.x core/lib/Drupal/Component/Plugin/Attribute/PluginID.php

Namespace

Drupal\Component\Annotation

File

core/lib/Drupal/Component/Annotation/PluginID.php

View source
<?php

namespace Drupal\Component\Annotation;


/**
 * Defines a Plugin annotation object that just contains an ID.
 *
 * @Annotation
 */
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;
    }

}

Classes

Title Deprecated Summary
PluginID Defines a Plugin annotation object that just contains an ID.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.