annotate core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 129ea1e6d783
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Component\Plugin\Derivative;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Provides additional plugin definitions based on an existing definition.
Chris@0 7 *
Chris@0 8 * @ingroup plugin_api
Chris@0 9 */
Chris@0 10 interface DeriverInterface {
Chris@0 11
Chris@0 12 /**
Chris@0 13 * Gets the definition of a derivative plugin.
Chris@0 14 *
Chris@0 15 * @param string $derivative_id
Chris@0 16 * The derivative id. The id must uniquely identify the derivative within a
Chris@0 17 * given base plugin, but derivative ids can be reused across base plugins.
Chris@17 18 * @param array|\Drupal\Component\Plugin\Definition\PluginDefinitionInterface $base_plugin_definition
Chris@0 19 * The definition of the base plugin from which the derivative plugin
Chris@0 20 * is derived. It is maybe an entire object or just some array, depending
Chris@0 21 * on the discovery mechanism.
Chris@0 22 *
Chris@0 23 * @return array
Chris@0 24 * The full definition array of the derivative plugin, typically a merge of
Chris@0 25 * $base_plugin_definition with extra derivative-specific information. NULL
Chris@0 26 * if the derivative doesn't exist.
Chris@0 27 */
Chris@0 28 public function getDerivativeDefinition($derivative_id, $base_plugin_definition);
Chris@0 29
Chris@0 30 /**
Chris@0 31 * Gets the definition of all derivatives of a base plugin.
Chris@0 32 *
Chris@0 33 * @param array $base_plugin_definition
Chris@0 34 * The definition array of the base plugin.
Chris@0 35 * @return array
Chris@0 36 * An array of full derivative definitions keyed on derivative id.
Chris@0 37 *
Chris@0 38 * @see getDerivativeDefinition()
Chris@0 39 */
Chris@0 40 public function getDerivativeDefinitions($base_plugin_definition);
Chris@0 41
Chris@0 42 }