Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / migrate_tools / src / Routing / RouteProcessor.php
1 <?php
2
3 namespace Drupal\migrate_tools\Routing;
4
5 use Drupal\Core\Render\BubbleableMetadata;
6 use Drupal\Core\RouteProcessor\OutboundRouteProcessorInterface;
7 use Symfony\Component\Routing\Route;
8
9 /**
10  * Route processor to expand migrate_group.
11  */
12 class RouteProcessor implements OutboundRouteProcessorInterface {
13
14   /**
15    * {@inheritdoc}
16    */
17   public function processOutbound($route_name, Route $route, array &$parameters, BubbleableMetadata $bubbleable_metadata = NULL) {
18     if ($route->hasDefault('_migrate_group')) {
19       if ($migration = \Drupal::entityTypeManager()->getStorage('migration')->load($parameters['migration'])) {
20         if ($group = $migration->get('migration_group')) {
21           $parameters['migration_group'] = $group;
22         }
23       }
24     }
25   }
26
27 }