class FedExEventSubscriber in Commerce FedEx 8
Same name in this branch
- 8 modules/dry_ice/src/EventSubscriber/FedExEventSubscriber.php \Drupal\commerce_fedex_dry_ice\EventSubscriber\FedExEventSubscriber
- 8 modules/dangerous/src/EventSubscriber/FedExEventSubscriber.php \Drupal\commerce_fedex_dangerous\EventSubscriber\FedExEventSubscriber
Provides a FedEx event subscriber.
@package Drupal\commerce_fedex_dry_ice\EventSubscriber
Hierarchy
- class \Drupal\commerce_fedex_dry_ice\EventSubscriber\FedExEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface uses StringTranslationTrait
Expanded class hierarchy of FedExEventSubscriber
1 string reference to 'FedExEventSubscriber'
- commerce_fedex_dry_ice.services.yml in modules/
dry_ice/ commerce_fedex_dry_ice.services.yml - modules/dry_ice/commerce_fedex_dry_ice.services.yml
1 service uses FedExEventSubscriber
File
- modules/
dry_ice/ src/ EventSubscriber/ FedExEventSubscriber.php, line 16
Namespace
Drupal\commerce_fedex_dry_ice\EventSubscriberView source
class FedExEventSubscriber implements EventSubscriberInterface {
use StringTranslationTrait;
/**
* The package type manager.
*
* @var \Drupal\commerce_shipping\PackageTypeManagerInterface
*/
protected $packageTypeManager;
/**
* Constructs a new ShippingMethodBase object.
*
* @param \Drupal\commerce_shipping\PackageTypeManagerInterface $package_type_manager
* The package type manager.
*/
public function __construct(PackageTypeManagerInterface $package_type_manager) {
$this->packageTypeManager = $package_type_manager;
}
/**
* Alter the rate request event.
*
* @param \Drupal\commerce_fedex\Event\RateRequestEvent $event
* The rate request event.
*/
public function onBeforeRateRequest(RateRequestEvent $event) {
$rateRequest = $event
->getRateRequest();
$shipment = $event
->getShipment();
// @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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FedExEventSubscriber:: |
protected | property | The package type manager. | |
FedExEventSubscriber:: |
public static | function | Function getSubscribedEvents. | |
FedExEventSubscriber:: |
public | function | Alter the rate request event. | |
FedExEventSubscriber:: |
public | function | Constructs a new ShippingMethodBase object. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |