3 namespace Drupal\Component\Plugin\Derivative;
6 * Provides a basic deriver.
8 abstract class DeriverBase implements DeriverInterface {
11 * List of derivative definitions.
15 protected $derivatives = [];
20 public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
21 if (!empty($this->derivatives) && !empty($this->derivatives[$derivative_id])) {
22 return $this->derivatives[$derivative_id];
24 $this->getDerivativeDefinitions($base_plugin_definition);
25 return $this->derivatives[$derivative_id];
31 public function getDerivativeDefinitions($base_plugin_definition) {
32 return $this->derivatives;