function PluginBase::getDerivativeId

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Component/Plugin/PluginBase.php \Drupal\Component\Plugin\PluginBase::getDerivativeId()
  2. 10 core/lib/Drupal/Component/Plugin/PluginBase.php \Drupal\Component\Plugin\PluginBase::getDerivativeId()
  3. 8.9.x core/lib/Drupal/Component/Plugin/PluginBase.php \Drupal\Component\Plugin\PluginBase::getDerivativeId()
4 calls to PluginBase::getDerivativeId()
InlineBlock::getEntity in core/modules/layout_builder/src/Plugin/Block/InlineBlock.php
Loads or creates the block content entity of the block.
InlineBlock::getEntity in core/modules/layout_builder/src/Plugin/Block/InlineBlock.php
Loads or creates the block content entity of the block.
LanguageBlock::build in core/modules/language/src/Plugin/Block/LanguageBlock.php
Builds and returns the renderable array for this block plugin.
LanguageBlock::build in core/modules/language/src/Plugin/Block/LanguageBlock.php
Builds and returns the renderable array for this block plugin.

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)) {
    [, $derivative_id] = explode(static::DERIVATIVE_SEPARATOR, $plugin_id, 2);
  }
  return $derivative_id;
}

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