You are here

class RouteSubscriber 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
  2. 8 modules/mailchimp_ecommerce_commerce/src/Routing/RouteSubscriber.php \Drupal\mailchimp_ecommerce_commerce\Routing\RouteSubscriber

Listens to the dynamic route events.

Hierarchy

  • class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of RouteSubscriber

1 string reference to 'RouteSubscriber'
mailchimp_ecommerce_ubercart.services.yml in modules/mailchimp_ecommerce_ubercart/mailchimp_ecommerce_ubercart.services.yml
modules/mailchimp_ecommerce_ubercart/mailchimp_ecommerce_ubercart.services.yml
1 service uses RouteSubscriber
mailchimp_ecommerce_ubercart.route_subscriber in modules/mailchimp_ecommerce_ubercart/mailchimp_ecommerce_ubercart.services.yml
\Drupal\mailchimp_ecommerce_ubercart\Routing\RouteSubscriber

File

modules/mailchimp_ecommerce_ubercart/src/Routing/RouteSubscriber.php, line 16
Contains \Drupal\mailchimp_ecommerce_ubercart\Routing\RouteSubscriber.

Namespace

Drupal\mailchimp_ecommerce_ubercart\Routing
View source
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    if ($route = $collection
      ->get('mailchimp_ecommerce.admin_settings')) {
      $route
        ->setDefault('_form', '\\Drupal\\mailchimp_ecommerce_ubercart\\Form\\MailchimpEcommerceUbercartAdminSettings');
    }
    if ($route = $collection
      ->get('mailchimp_ecommerce.sync')) {
      $route
        ->setDefault('_form', '\\Drupal\\mailchimp_ecommerce_ubercart\\Form\\MailchimpEcommerceUbercartSync');
    }
    if ($route = $collection
      ->get('mailchimp_ecommerce.sync_orders')) {
      $route
        ->setDefault('_form', '\\Drupal\\mailchimp_ecommerce_ubercart\\Form\\MailchimpEcommerceUbercartSyncOrders');
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RouteSubscriber::alterRoutes protected function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1