You are here

class FedExEventSubscriber in Commerce FedEx 8

Same name in this branch
  1. 8 modules/dry_ice/src/EventSubscriber/FedExEventSubscriber.php \Drupal\commerce_fedex_dry_ice\EventSubscriber\FedExEventSubscriber
  2. 8 modules/dangerous/src/EventSubscriber/FedExEventSubscriber.php \Drupal\commerce_fedex_dangerous\EventSubscriber\FedExEventSubscriber

Provides a FedEx event subscriber.

@package Drupal\commerce_fedex_dangerous\EventSubscriber

Hierarchy

  • class \Drupal\commerce_fedex_dangerous\EventSubscriber\FedExEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of FedExEventSubscriber

1 string reference to 'FedExEventSubscriber'
commerce_fedex_dangerous.services.yml in modules/dangerous/commerce_fedex_dangerous.services.yml
modules/dangerous/commerce_fedex_dangerous.services.yml
1 service uses FedExEventSubscriber
commerce_fedex_dangerous.fedex_event_subscriber in modules/dangerous/commerce_fedex_dangerous.services.yml
\Drupal\commerce_fedex_dangerous\EventSubscriber\FedExEventSubscriber

File

modules/dangerous/src/EventSubscriber/FedExEventSubscriber.php, line 14

Namespace

Drupal\commerce_fedex_dangerous\EventSubscriber
View source
class FedExEventSubscriber implements EventSubscriberInterface {

  /**
   * Alter the rate request event.
   *
   * @param \Drupal\commerce_fedex\Event\RateRequestEvent $event
   *   The rate request event.
   */
  public function onBeforeRateRequest(RateRequestEvent $event) {
    $rate_request = $event
      ->getRateRequest();

    // @todo Alter the rate request.
  }

  /**
   * Function getSubscribedEvents.
   *
   * @return array
   *   The subscribed events.
   */
  public static function getSubscribedEvents() {
    $events = [];
    $events[CommerceFedExEvents::BEFORE_RATE_REQUEST][] = [
      'onBeforeRateRequest',
    ];
    return $events;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FedExEventSubscriber::getSubscribedEvents public static function Function getSubscribedEvents.
FedExEventSubscriber::onBeforeRateRequest public function Alter the rate request event.