3 namespace Drupal\Component\Plugin\Derivative;
6 * Provides additional plugin definitions based on an existing definition.
10 interface DeriverInterface {
13 * Gets the definition of a derivative plugin.
15 * @param string $derivative_id
16 * The derivative id. The id must uniquely identify the derivative within a
17 * given base plugin, but derivative ids can be reused across base plugins.
18 * @param mixed $base_plugin_definition
19 * The definition of the base plugin from which the derivative plugin
20 * is derived. It is maybe an entire object or just some array, depending
21 * on the discovery mechanism.
24 * The full definition array of the derivative plugin, typically a merge of
25 * $base_plugin_definition with extra derivative-specific information. NULL
26 * if the derivative doesn't exist.
28 public function getDerivativeDefinition($derivative_id, $base_plugin_definition);
31 * Gets the definition of all derivatives of a base plugin.
33 * @param array $base_plugin_definition
34 * The definition array of the base plugin.
36 * An array of full derivative definitions keyed on derivative id.
38 * @see getDerivativeDefinition()
40 public function getDerivativeDefinitions($base_plugin_definition);