You are here

public function ShippingRatesEvent::__construct in Commerce Shipping 8.2

Constructs a new ShippingRatesEvent.

Parameters

\Drupal\commerce_shipping\ShippingRate[] $rates: The shipping rates.

\Drupal\commerce_shipping\Entity\ShippingMethodInterface $shipping_method: The shipping method calculating the rates.

\Drupal\commerce_shipping\Entity\ShipmentInterface $shipment: The shipment.

File

src/Event/ShippingRatesEvent.php, line 47

Class

ShippingRatesEvent
Defines the event for reacting to shipping rate calculation.

Namespace

Drupal\commerce_shipping\Event

Code

public function __construct(array $rates, ShippingMethodInterface $shipping_method, ShipmentInterface $shipment) {
  $this->rates = $rates;
  $this->shippingMethod = $shipping_method;
  $this->shipment = $shipment;
}