class RouteSubscriber in Commerce Pricelist 8.2
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\commerce_pricelist\EventSubscriber\RouteSubscriber
Expanded class hierarchy of RouteSubscriber
1 string reference to 'RouteSubscriber'
1 service uses RouteSubscriber
File
- src/
EventSubscriber/ RouteSubscriber.php, line 8
Namespace
Drupal\commerce_pricelist\EventSubscriberView source
class RouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('view.commerce_product_variation_prices.page')) {
$route
->setOption('_admin_route', TRUE);
$parameters = $route
->getOption('parameters') ?: [];
$parameters['commerce_product']['type'] = 'entity:commerce_product';
$parameters['commerce_product_variation']['type'] = 'entity:commerce_product_variation';
$route
->setOption('parameters', $parameters);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |