DeriverBase.php in Drupal 10
File
core/lib/Drupal/Component/Plugin/Derivative/DeriverBase.php
View source
<?php
namespace Drupal\Component\Plugin\Derivative;
abstract class DeriverBase implements DeriverInterface {
protected $derivatives = [];
public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
if (!empty($this->derivatives) && !empty($this->derivatives[$derivative_id])) {
return $this->derivatives[$derivative_id];
}
$this
->getDerivativeDefinitions($base_plugin_definition);
return $this->derivatives[$derivative_id];
}
public function getDerivativeDefinitions($base_plugin_definition) {
return $this->derivatives;
}
}