You are here

interface PluginDefinitionInterface in Plugin 8.2

Defines a plugin definition.

Hierarchy

Expanded class hierarchy of PluginDefinitionInterface

All classes that implement PluginDefinitionInterface

9 files declare their use of PluginDefinitionInterface
ArrayPluginDefinitionDecoratorTest.php in tests/src/Unit/PluginDefinition/ArrayPluginDefinitionDecoratorTest.php
MergeablePluginDefinitionTraitTest.php in tests/src/Unit/PluginDefinition/MergeablePluginDefinitionTraitTest.php
PluginHierarchyTrait.php in src/PluginHierarchyTrait.php
PluginIdTest.php in tests/src/Unit/Plugin/views/filter/PluginIdTest.php
PluginLabelTest.php in tests/src/Unit/Plugin/Field/FieldFormatter/PluginLabelTest.php

... See full list

File

src/PluginDefinition/PluginDefinitionInterface.php, line 12

Namespace

Drupal\plugin\PluginDefinition
View source
interface PluginDefinitionInterface extends ComponentPluginDefinitionInterface {

  /**
   * Sets the plugin ID.
   *
   * @param string $id
   *   The plugin ID.
   *
   * @return $this
   */
  public function setId($id);

  /**
   * Gets the plugin ID.
   *
   * @return string
   *   The plugin ID.
   */
  public function getId();

  /**
   * Sets the plugin provider.
   *
   * The provider is the name of the module that provides the plugin, or "core',
   * or "component".
   *
   * @param string $provider
   *   The provider.
   *
   * @return $this
   */
  public function setProvider($provider);

  /**
   * 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();

  /**
   * Merges another definition into this one, using the other for defaults.
   *
   * @param static $other_definition
   *   The other definition to merge into $this. It will not override $this, but
   *   be used to extract default values from instead.
   *
   * @return $this
   *
   * @throws \InvalidArgumentException
   *   Thrown if $other_definition is no instance of $this.
   */
  public function mergeDefaultDefinition(PluginDefinitionInterface $other_definition);

  /**
   * Merges another definition into this one, using the other for overrides.
   *
   * @param static $other_definition
   *   The other definition to merge into $this. It will override any values
   *   already set in $this.
   *
   * @return $this
   *
   * @throws \InvalidArgumentException
   *   Thrown if $other_definition is no instance of $this.
   */
  public function mergeOverrideDefinition(PluginDefinitionInterface $other_definition);

}

Members

Namesort descending Modifiers Type Description Overrides
PluginDefinitionInterface::getClass public function Gets the class. 1
PluginDefinitionInterface::getId public function Gets the plugin ID. 2
PluginDefinitionInterface::getProvider public function Gets the plugin provider. Overrides PluginDefinitionInterface::getProvider 2
PluginDefinitionInterface::id public function Gets the unique identifier of the plugin. 1
PluginDefinitionInterface::mergeDefaultDefinition public function Merges another definition into this one, using the other for defaults.
PluginDefinitionInterface::mergeOverrideDefinition public function Merges another definition into this one, using the other for overrides.
PluginDefinitionInterface::setClass public function Sets the class. 1
PluginDefinitionInterface::setId public function Sets the plugin ID. 2
PluginDefinitionInterface::setProvider public function Sets the plugin provider. 2