function BreadcrumbManager::getSortedBuilders

Same name in other branches
  1. 9 core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php \Drupal\Core\Breadcrumb\BreadcrumbManager::getSortedBuilders()
  2. 8.9.x core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php \Drupal\Core\Breadcrumb\BreadcrumbManager::getSortedBuilders()
  3. 10 core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php \Drupal\Core\Breadcrumb\BreadcrumbManager::getSortedBuilders()

Returns the sorted array of breadcrumb builders.

Return value

\Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface[] An array of breadcrumb builder objects.

1 call to BreadcrumbManager::getSortedBuilders()
BreadcrumbManager::build in core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php

File

core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php, line 108

Class

BreadcrumbManager
Provides a breadcrumb manager.

Namespace

Drupal\Core\Breadcrumb

Code

protected function getSortedBuilders() {
    if (!isset($this->sortedBuilders)) {
        // Sort the builders according to priority.
        krsort($this->builders);
        // Merge nested builders from $this->builders into $this->sortedBuilders.
        $this->sortedBuilders = array_merge(...$this->builders);
    }
    return $this->sortedBuilders;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.