You are here

class USPSRateRequestEvent in Commerce USPS 8

Rate request event for USPS.

Hierarchy

  • class \Drupal\commerce_usps\Event\USPSRateRequestEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of USPSRateRequestEvent

1 file declares its use of USPSRateRequestEvent
USPSRateRequestBase.php in src/USPSRateRequestBase.php

File

src/Event/USPSRateRequestEvent.php, line 12

Namespace

Drupal\commerce_usps\Event
View source
class USPSRateRequestEvent extends Event {

  /**
   * The rate request object.
   *
   * @var \USPS\Rate
   */
  protected $rateRequest;

  /**
   * The shipment being requested.
   *
   * @var \Drupal\commerce_shipping\Entity\ShipmentInterface
   *   The commerce shipment entity.
   */
  protected $shipment;

  /**
   * RateRequestEvent constructor.
   *
   * @param \USPS\Rate $rate_request
   *   The USPS rate request object.
   * @param \Drupal\commerce_shipping\Entity\ShipmentInterface $shipment
   *   The Commerce Shipment entity.
   */
  public function __construct(Rate $rate_request, ShipmentInterface $shipment) {
    $this->rateRequest = $rate_request;
    $this->shipment = $shipment;
  }

  /**
   * Gets the rate request object.
   *
   * @return \USPS\Rate
   *   The rate request object.
   */
  public function getRateRequest() {
    return $this->rateRequest;
  }

  /**
   * Set the rate request.
   *
   * @param \USPS\Rate $rate_request
   *   The USPS rate object.
   */
  public function setRateRequest(Rate $rate_request) {
    $this->rateRequest = $rate_request;
  }

  /**
   * Gets the shipment.
   *
   * @return \Drupal\commerce_shipping\Entity\ShipmentInterface
   *   The shipment.
   */
  public function getShipment() {
    return $this->shipment;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
USPSRateRequestEvent::$rateRequest protected property The rate request object.
USPSRateRequestEvent::$shipment protected property The shipment being requested.
USPSRateRequestEvent::getRateRequest public function Gets the rate request object.
USPSRateRequestEvent::getShipment public function Gets the shipment.
USPSRateRequestEvent::setRateRequest public function Set the rate request.
USPSRateRequestEvent::__construct public function RateRequestEvent constructor.