You are here

public function StaticDiscoveryDecorator::getDefinitions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator::getDefinitions()

Gets the definition of all plugins for this type.

Return value

mixed[] An array of plugin definitions (empty array if no definitions were found). Keys are plugin IDs.

Overrides StaticDiscovery::getDefinitions

File

core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php, line 57
Contains \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator.

Class

StaticDiscoveryDecorator
A decorator that allows manual registration of undiscoverable definitions.

Namespace

Drupal\Component\Plugin\Discovery

Code

public function getDefinitions() {
  if (isset($this->registerDefinitions)) {
    call_user_func($this->registerDefinitions);
  }
  $this->definitions += $this->decorated
    ->getDefinitions();
  return parent::getDefinitions();
}