You are here

public function BreadcrumbTitleResolverManager::getDefinitions in Breadcrumb Manager 8

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 DefaultPluginManager::getDefinitions

See also

\Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()

1 call to BreadcrumbTitleResolverManager::getDefinitions()
BreadcrumbTitleResolverManager::getInstances in src/Plugin/BreadcrumbTitleResolverManager.php
Get instances.

File

src/Plugin/BreadcrumbTitleResolverManager.php, line 63

Class

BreadcrumbTitleResolverManager
Provides the Breadcrumb title resolver plugin manager.

Namespace

Drupal\breadcrumb_manager\Plugin

Code

public function getDefinitions() {
  $definitions = parent::getDefinitions();
  $resolvers = $this->config
    ->get('title_resolvers');
  foreach ($definitions as $id => $definition) {
    if (isset($resolvers[$id]['weight'])) {
      $definitions[$id]['weight'] = $resolvers[$id]['weight'];
    }
    if (isset($resolvers[$id]['enabled'])) {
      $definitions[$id]['enabled'] = $resolvers[$id]['enabled'];
    }
  }
  uasort($definitions, [
    $this,
    'sortByWeight',
  ]);
  return $definitions;
}