Finds a Drupal\Component\Plugin\Discovery\DerivativeInterface.
This Drupal\Component\Plugin\Discovery\DerivativeInterface can fetch derivatives for the plugin.
string $base_plugin_id: The base plugin id of the plugin.
array $base_definition: The base plugin definition to build derivatives.
Drupal\Component\Plugin\Discovery\DerivativeInterface|null A DerivativeInterface or null if none exists for the plugin.
protected function getDerivativeFetcher($base_plugin_id, array $base_definition) {
if (!isset($this->derivativeFetchers[$base_plugin_id])) {
$this->derivativeFetchers[$base_plugin_id] = FALSE;
if (isset($base_definition['derivative'])) {
$class = $base_definition['derivative'];
$this->derivativeFetchers[$base_plugin_id] = new $class($base_plugin_id);
}
}
return $this->derivativeFetchers[$base_plugin_id] ?: NULL;
}