class USPSShipmentEvent in Commerce USPS 8
Rate request event for USPS.
Hierarchy
- class \Drupal\commerce_usps\Event\USPSShipmentEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of USPSShipmentEvent
1 file declares its use of USPSShipmentEvent
File
- src/
Event/ USPSShipmentEvent.php, line 12
Namespace
Drupal\commerce_usps\EventView source
class USPSShipmentEvent extends Event {
/**
* The rate package.
*
* @var \USPS\RatePackage
*/
protected $usps_package;
/**
* The commerce shipment.
*
* @var \Drupal\commerce_shipping\Entity\ShipmentInterface
*/
protected $commerce_shipment;
/**
* RateRequestEvent constructor.
*
* @param \USPS\RatePackage $usps_package
* The USPS rate package object.
* @param \Drupal\commerce_shipping\Entity\ShipmentInterface $commerce_shipment
* The Commerce Shipment entity.
*/
public function __construct(RatePackage $usps_package, ShipmentInterface $commerce_shipment) {
$this->usps_package = $usps_package;
$this->commerce_shipment = $commerce_shipment;
}
/**
* Get the rate package.
*
* @return \USPS\RatePackage
* The rate request object.
*/
public function getPackage() {
return $this->usps_package;
}
/**
* Set the rate package.
*
* @param \USPS\RatePackage $usps_package
* The USPS package object.
*/
public function setPackage(RatePackage $usps_package) {
$this->usps_package = $usps_package;
}
/**
* Gets the shipment.
*
* @return \Drupal\commerce_shipping\Entity\ShipmentInterface
* The shipment.
*/
public function getShipment() {
return $this->commerce_shipment;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
USPSShipmentEvent:: |
protected | property | The commerce shipment. | |
USPSShipmentEvent:: |
protected | property | The rate package. | |
USPSShipmentEvent:: |
public | function | Get the rate package. | |
USPSShipmentEvent:: |
public | function | Gets the shipment. | |
USPSShipmentEvent:: |
public | function | Set the rate package. | |
USPSShipmentEvent:: |
public | function | RateRequestEvent constructor. |