You are here

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
USPSShipmentBase.php in src/USPSShipmentBase.php

File

src/Event/USPSShipmentEvent.php, line 12

Namespace

Drupal\commerce_usps\Event
View 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

Namesort descending Modifiers Type Description Overrides
USPSShipmentEvent::$commerce_shipment protected property The commerce shipment.
USPSShipmentEvent::$usps_package protected property The rate package.
USPSShipmentEvent::getPackage public function Get the rate package.
USPSShipmentEvent::getShipment public function Gets the shipment.
USPSShipmentEvent::setPackage public function Set the rate package.
USPSShipmentEvent::__construct public function RateRequestEvent constructor.