class Plugin

Same name in this branch
  1. 11.x composer/Plugin/Scaffold/Plugin.php \Drupal\Composer\Plugin\Scaffold\Plugin
  2. 11.x core/lib/Drupal/Component/Annotation/Plugin.php \Drupal\Component\Annotation\Plugin
Same name and namespace in other branches
  1. 9 composer/Plugin/Scaffold/Plugin.php \Drupal\Composer\Plugin\Scaffold\Plugin
  2. 9 core/lib/Drupal/Component/Annotation/Plugin.php \Drupal\Component\Annotation\Plugin
  3. 8.9.x composer/Plugin/Scaffold/Plugin.php \Drupal\Composer\Plugin\Scaffold\Plugin
  4. 8.9.x core/lib/Drupal/Component/Annotation/Plugin.php \Drupal\Component\Annotation\Plugin
  5. 10 composer/Plugin/Scaffold/Plugin.php \Drupal\Composer\Plugin\Scaffold\Plugin
  6. 10 core/lib/Drupal/Component/Annotation/Plugin.php \Drupal\Component\Annotation\Plugin
  7. 10 core/lib/Drupal/Component/Plugin/Attribute/Plugin.php \Drupal\Component\Plugin\Attribute\Plugin

Defines a Plugin attribute object.

Attributes in plugin classes can use this class in order to pass various metadata about the plugin through the parser to DiscoveryInterface::getDefinitions() calls.

Hierarchy

Expanded class hierarchy of Plugin

Related topics

55 files declare their use of Plugin
Action.php in core/lib/Drupal/Core/Action/Attribute/Action.php
Archiver.php in core/lib/Drupal/Core/Archiver/Attribute/Archiver.php
AttributeBridgeDecoratorTest.php in core/tests/Drupal/Tests/Component/Plugin/Discovery/AttributeBridgeDecoratorTest.php
AttributeClassDiscovery.php in core/lib/Drupal/Component/Plugin/Discovery/AttributeClassDiscovery.php
AttributeDiscoveryTest1.php in core/tests/Drupal/Tests/Component/Plugin/Attribute/Fixtures/Plugins/PluginNamespace/AttributeDiscoveryTest1.php

... See full list

23 string references to 'Plugin'
Action::create in core/modules/system/src/Entity/Action.php
Constructs a new entity object, without permanently saving it.
ActionFormBase::form in core/modules/action/src/Form/ActionFormBase.php
Gets the actual form array to be built.
ActionValidationTest::testInvalidPluginId in core/modules/system/tests/src/Kernel/Entity/ActionValidationTest.php
Tests that the action plugin ID is validated.
block.schema.yml in core/modules/block/config/schema/block.schema.yml
core/modules/block/config/schema/block.schema.yml
BlockCreationTrait::placeBlock in core/modules/block/tests/src/Traits/BlockCreationTrait.php
Creates a block instance based on default settings.

... See full list

File

core/lib/Drupal/Component/Plugin/Attribute/Plugin.php, line 14

Namespace

Drupal\Component\Plugin\Attribute
View source
class Plugin extends AttributeBase {
    
    /**
     * Constructs a plugin attribute object.
     *
     * @param string $id
     *   The attribute class ID.
     * @param class-string|null $deriver
     *   (optional) The deriver class.
     */
    public function __construct(string $id, ?string $deriver = NULL) {
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AttributeBase::$class protected property The class used for this attribute class.
AttributeBase::$provider protected property The provider of the attribute class.
AttributeBase::get public function Gets the value of an attribute. Overrides AttributeInterface::get 6
AttributeBase::getClass public function Gets the class of the attribute class. Overrides AttributeInterface::getClass 1
AttributeBase::getId public function Gets the unique ID for this attribute class. Overrides AttributeInterface::getId
AttributeBase::getProvider public function Gets the name of the provider of the attribute class. Overrides AttributeInterface::getProvider
AttributeBase::setClass public function Sets the class of the attributed class. Overrides AttributeInterface::setClass 1
AttributeBase::setProvider public function Sets the name of the provider of the attribute class. Overrides AttributeInterface::setProvider
Plugin::__construct public function Constructs a plugin attribute object. Overrides AttributeBase::__construct 47

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