You are here

protected function RouteEnhancerCollectorTrait::sortRouteEnhancers in Page Manager 8

Same name and namespace in other branches
  1. 8.4 src/Routing/RouteEnhancerCollectorTrait.php \Drupal\page_manager\Routing\RouteEnhancerCollectorTrait::sortRouteEnhancers()

Sort enhancers by priority.

The highest priority number is the highest priority (reverse sorting).

Return value

\Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface[] The sorted enhancers.

1 call to RouteEnhancerCollectorTrait::sortRouteEnhancers()
RouteEnhancerCollectorTrait::getRouteEnhancers in src/Routing/RouteEnhancerCollectorTrait.php
Sorts the enhancers and flattens them.

File

src/Routing/RouteEnhancerCollectorTrait.php, line 76
Contains \Drupal\page_manager\Routing\RouteEnhancerCollectorTrait.

Class

RouteEnhancerCollectorTrait
Provides a trait to make a service a collector of route enhancers.

Namespace

Drupal\page_manager\Routing

Code

protected function sortRouteEnhancers() {
  $sortedEnhancers = array();
  krsort($this->enhancers);
  foreach ($this->enhancers as $enhancers) {
    $sortedEnhancers = array_merge($sortedEnhancers, $enhancers);
  }
  return $sortedEnhancers;
}