You are here

class RateRequestEvent in Commerce FedEx 8

Defines the rate request event for FedEx.

Hierarchy

  • class \Drupal\commerce_fedex\Event\RateRequestEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of RateRequestEvent

See also

\Drupal\commerce_fedex\Event\CommerceFedExEvents

3 files declare their use of RateRequestEvent
FedEx.php in src/Plugin/Commerce/ShippingMethod/FedEx.php
FedExEventSubscriber.php in modules/dry_ice/src/EventSubscriber/FedExEventSubscriber.php
FedExEventSubscriber.php in modules/dangerous/src/EventSubscriber/FedExEventSubscriber.php

File

src/Event/RateRequestEvent.php, line 15

Namespace

Drupal\commerce_fedex\Event
View source
class RateRequestEvent extends Event {

  /**
   * The rate request object.
   *
   * @var \NicholasCreativeMedia\FedExPHP\Structs\RateRequest
   */
  protected $rateRequest;

  /**
   * The FedEx rate service being used.
   *
   * @var \NicholasCreativeMedia\FedExPHP\Services\RateService
   */
  protected $rateService;

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

  /**
   * Constructs a new BeforePackEvent object.
   *
   * @param \NicholasCreativeMedia\FedExPHP\Structs\RateRequest $rate_request
   *   The rate request object.
   * @param \NicholasCreativeMedia\FedExPHP\Services\RateService $rate_service
   *   The FedEx rate service being used.
   * @param \Drupal\commerce_shipping\Entity\ShipmentInterface $shipment
   *   The shipment being requested.
   */
  public function __construct(RateRequest $rate_request, RateService $rate_service, ShipmentInterface $shipment) {
    $this->rateRequest = $rate_request;
    $this->rateService = $rate_service;
    $this->shipment = $shipment;
  }

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

  /**
   * Sets the rate request object.
   *
   * @param \NicholasCreativeMedia\FedExPHP\Structs\RateRequest $rate_request
   *   The rate request object.
   *
   * @return $this
   */
  public function setRateRequest(RateRequest $rate_request) {
    $this->rateRequest = $rate_request;
    return $this;
  }

  /**
   * Gets the rate service.
   *
   * @return \NicholasCreativeMedia\FedExPHP\Services\RateService
   *   The rate service.
   */
  public function getRateService() {
    return $this->rateService;
  }

  /**
   * Sets the rate service.
   *
   * @param \NicholasCreativeMedia\FedExPHP\Services\RateService $rate_service
   *   The rate service.
   *
   * @return $this
   */
  public function setRateService(RateService $rate_service) {
    $this->rateService = $rate_service;
    return $this;
  }

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
RateRequestEvent::$rateRequest protected property The rate request object.
RateRequestEvent::$rateService protected property The FedEx rate service being used.
RateRequestEvent::$shipment protected property The shipment being requested.
RateRequestEvent::getRateRequest public function Gets the rate request object.
RateRequestEvent::getRateService public function Gets the rate service.
RateRequestEvent::getShipment public function Gets the shipment.
RateRequestEvent::setRateRequest public function Sets the rate request object.
RateRequestEvent::setRateService public function Sets the rate service.
RateRequestEvent::setShipment public function Sets the shipment.
RateRequestEvent::__construct public function Constructs a new BeforePackEvent object.