"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php" (26 Nov 2020, 1430 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "DeriverInterface.php" see the Fossies "Dox" file reference documentation.

    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 array|\Drupal\Component\Plugin\Definition\PluginDefinitionInterface $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    *
   36    * @return array
   37    *   An array of full derivative definitions keyed on derivative id.
   38    *
   39    * @see getDerivativeDefinition()
   40    */
   41   public function getDerivativeDefinitions($base_plugin_definition);
   42 
   43 }