You are here

protected function RouteSubscriber::alterRoutes in Mailchimp E-Commerce 8

Same name in this branch
  1. 8 modules/mailchimp_ecommerce_ubercart/src/Routing/RouteSubscriber.php \Drupal\mailchimp_ecommerce_ubercart\Routing\RouteSubscriber::alterRoutes()
  2. 8 modules/mailchimp_ecommerce_commerce/src/Routing/RouteSubscriber.php \Drupal\mailchimp_ecommerce_commerce\Routing\RouteSubscriber::alterRoutes()

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

modules/mailchimp_ecommerce_commerce/src/Routing/RouteSubscriber.php, line 21
Contains \Drupal\mailchimp_ecommerce_commerce\Routing\RouteSubscriber.

Class

RouteSubscriber
Listens to the dynamic route events.

Namespace

Drupal\mailchimp_ecommerce_commerce\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('mailchimp_ecommerce.admin_settings')) {
    $route
      ->setDefault('_form', '\\Drupal\\mailchimp_ecommerce_commerce\\Form\\MailchimpEcommerceCommerceAdminSettings');
  }
  if ($route = $collection
    ->get('mailchimp_ecommerce.sync')) {
    $route
      ->setDefault('_form', '\\Drupal\\mailchimp_ecommerce_commerce\\Form\\MailchimpEcommerceCommerceSync');
  }
  if ($route = $collection
    ->get('mailchimp_ecommerce.sync_orders')) {
    $route
      ->setDefault('_form', '\\Drupal\\mailchimp_ecommerce_commerce\\Form\\MailchimpEcommerceCommerceSyncOrders');
  }
}