You are here

public function PluginBase::getDerivativeId in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Plugin/PluginBase.php \Drupal\Component\Plugin\PluginBase::getDerivativeId()

Gets the derivative_id of the plugin instance.

Return value

string|null The derivative_id of the plugin instance NULL otherwise.

Overrides DerivativeInspectionInterface::getDerivativeId

11 calls to PluginBase::getDerivativeId()
BlockContentBlock::build in core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
Builds and returns the renderable array for this block plugin.
BlockContentBlock::getEntity in core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
Loads the block content entity of the block.
EntityBundle::buildConfigurationForm in core/lib/Drupal/Core/Entity/Plugin/Condition/EntityBundle.php
Form constructor.
EntityBundle::evaluate in core/lib/Drupal/Core/Entity/Plugin/Condition/EntityBundle.php
Evaluates the condition and returns TRUE or FALSE accordingly.
InlineBlock::getEntity in core/modules/layout_builder/src/Plugin/Block/InlineBlock.php
Loads or creates the block content entity of the block.

... See full list

File

core/lib/Drupal/Component/Plugin/PluginBase.php, line 80

Class

PluginBase
Base class for plugins wishing to support metadata inspection.

Namespace

Drupal\Component\Plugin

Code

public function getDerivativeId() {
  $plugin_id = $this
    ->getPluginId();
  $derivative_id = NULL;
  if (strpos($plugin_id, static::DERIVATIVE_SEPARATOR)) {
    list(, $derivative_id) = explode(static::DERIVATIVE_SEPARATOR, $plugin_id, 2);
  }
  return $derivative_id;
}