You are here

public function AbstractPatternsDeriver::getDerivativeDefinitions in UI Patterns 8

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/Deriver/AbstractPatternsDeriver.php, line 60

Class

AbstractPatternsDeriver
Class AbstractPatternsDeriver.

Namespace

Drupal\ui_patterns\Plugin\Deriver

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach ($this
    ->getPatterns() as $pattern) {
    $pattern
      ->setDeriver($base_plugin_definition['deriver']);
    $pattern
      ->setClass($base_plugin_definition['class']);
    if ($this
      ->isValidPatternDefinition($pattern)) {
      $this->derivatives[$pattern
        ->id()] = $pattern;
    }
  }
  return $this->derivatives;
}