interface PluginDefinitionInterface

Same name in other branches
  1. 9 core/lib/Drupal/Component/Plugin/Definition/PluginDefinitionInterface.php \Drupal\Component\Plugin\Definition\PluginDefinitionInterface
  2. 8.9.x core/lib/Drupal/Component/Plugin/Definition/PluginDefinitionInterface.php \Drupal\Component\Plugin\Definition\PluginDefinitionInterface
  3. 11.x core/lib/Drupal/Component/Plugin/Definition/PluginDefinitionInterface.php \Drupal\Component\Plugin\Definition\PluginDefinitionInterface

Defines a plugin definition.

Object-based plugin definitions MUST implement this interface.

Hierarchy

Expanded class hierarchy of PluginDefinitionInterface

All classes that implement PluginDefinitionInterface

8 files declare their use of PluginDefinitionInterface
CKEditor5PluginDefinition.php in core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php
DefaultFactory.php in core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php
DefaultFactoryTest.php in core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php
DefaultPluginManager.php in core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
EntityTypeInterface.php in core/lib/Drupal/Core/Entity/EntityTypeInterface.php

... See full list

File

core/lib/Drupal/Component/Plugin/Definition/PluginDefinitionInterface.php, line 12

Namespace

Drupal\Component\Plugin\Definition
View source
interface PluginDefinitionInterface {
    
    /**
     * Gets the unique identifier of the plugin.
     *
     * @return string
     *   The unique identifier of the plugin.
     */
    public function id();
    
    /**
     * Sets the class.
     *
     * @param string $class
     *   A fully qualified class name.
     *
     * @return static
     *
     * @throws \InvalidArgumentException
     *   If the class is invalid.
     */
    public function setClass($class);
    
    /**
     * Gets the class.
     *
     * @return string
     *   A fully qualified class name.
     */
    public function getClass();
    
    /**
     * Gets the plugin provider.
     *
     * The provider is the name of the module that provides the plugin, or "core',
     * or "component".
     *
     * @return string
     *   The provider.
     */
    public function getProvider();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
PluginDefinitionInterface::getClass public function Gets the class. 1
PluginDefinitionInterface::getProvider public function Gets the plugin provider. 1
PluginDefinitionInterface::id public function Gets the unique identifier of the plugin. 1
PluginDefinitionInterface::setClass public function Sets the class. 1

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