class FilterShippingMethodsEvent in Commerce Shipping 8.2
Defines the event for filtering the available shipping methods.
Hierarchy
- class \Drupal\commerce_shipping\Event\FilterShippingMethodsEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of FilterShippingMethodsEvent
See also
\Drupal\commerce_shipping\Event\ShippingEvents
2 files declare their use of FilterShippingMethodsEvent
- FilterShippingMethodsSubscriber.php in tests/
modules/ commerce_shipping_test/ src/ EventSubscriber/ FilterShippingMethodsSubscriber.php - ShippingMethodStorage.php in src/
ShippingMethodStorage.php
File
- src/
Event/ FilterShippingMethodsEvent.php, line 13
Namespace
Drupal\commerce_shipping\EventView source
class FilterShippingMethodsEvent extends Event {
/**
* The shipping methods.
*
* @var \Drupal\commerce_shipping\Entity\ShippingMethodInterface[]
*/
protected $shippingMethods;
/**
* The shipment.
*
* @var \Drupal\commerce_shipping\Entity\ShipmentInterface
*/
protected $shipment;
/**
* Constructs a new FilterShippingMethodsEvent object.
*
* @param \Drupal\commerce_shipping\Entity\ShippingMethodInterface[] $shipping_methods
* The shipping methods.
* @param \Drupal\commerce_shipping\Entity\ShipmentInterface $shipment
* The shipment.
*/
public function __construct(array $shipping_methods, ShipmentInterface $shipment) {
$this->shippingMethods = $shipping_methods;
$this->shipment = $shipment;
}
/**
* Gets the shipping methods.
*
* @return \Drupal\commerce_shipping\Entity\ShippingMethodInterface[]
* The shipping methods.
*/
public function getShippingMethods() {
return $this->shippingMethods;
}
/**
* Sets the shipping methods.
*
* @param \Drupal\commerce_shipping\Entity\ShippingMethodInterface[] $shipping_methods
* The shipping methods.
*
* @return $this
*/
public function setShippingMethods(array $shipping_methods) {
$this->shippingMethods = $shipping_methods;
return $this;
}
/**
* Gets the shipment.
*
* @return \Drupal\commerce_shipping\Entity\ShipmentInterface
* The shipment.
*/
public function getShipment() {
return $this->shipment;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FilterShippingMethodsEvent:: |
protected | property | The shipment. | |
FilterShippingMethodsEvent:: |
protected | property | The shipping methods. | |
FilterShippingMethodsEvent:: |
public | function | Gets the shipment. | |
FilterShippingMethodsEvent:: |
public | function | Gets the shipping methods. | |
FilterShippingMethodsEvent:: |
public | function | Sets the shipping methods. | |
FilterShippingMethodsEvent:: |
public | function | Constructs a new FilterShippingMethodsEvent object. |