comparison core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 129ea1e6d783
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Component\Plugin\Derivative;
4
5 /**
6 * Provides additional plugin definitions based on an existing definition.
7 *
8 * @ingroup plugin_api
9 */
10 interface DeriverInterface {
11
12 /**
13 * Gets the definition of a derivative plugin.
14 *
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.
22 *
23 * @return array
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.
27 */
28 public function getDerivativeDefinition($derivative_id, $base_plugin_definition);
29
30 /**
31 * Gets the definition of all derivatives of a base plugin.
32 *
33 * @param array $base_plugin_definition
34 * The definition array of the base plugin.
35 * @return array
36 * An array of full derivative definitions keyed on derivative id.
37 *
38 * @see getDerivativeDefinition()
39 */
40 public function getDerivativeDefinitions($base_plugin_definition);
41
42 }