You are here

public function BreadcrumbTitleResolverManager::getInstances in Breadcrumb Manager 8

Get instances.

Return value

\Drupal\breadcrumb_manager\Plugin\BreadcrumbTitleResolverInterface[] An array of breadcrumb title resolvers.

File

src/Plugin/BreadcrumbTitleResolverManager.php, line 45

Class

BreadcrumbTitleResolverManager
Provides the Breadcrumb title resolver plugin manager.

Namespace

Drupal\breadcrumb_manager\Plugin

Code

public function getInstances() {
  $instances = [];
  foreach ($this
    ->getDefinitions() as $pluginId => $definition) {
    try {
      $instance = $this
        ->createInstance($pluginId);
      $instance
        ->setActive($definition['enabled']);
      $instances[] = $instance;
    } catch (PluginException $e) {
      \Drupal::messenger()
        ->addError($e
        ->getMessage());
    }
  }
  return $instances;
}