You are here

class ShipmentEvent in Commerce Shipping 8.2

Defines the shipment event.

Hierarchy

  • class \Drupal\commerce\EventBase extends \Drupal\Component\EventDispatcher\Event

Expanded class hierarchy of ShipmentEvent

See also

\Drupal\commerce_shipping\Event\ShippingEvents

1 file declares its use of ShipmentEvent
ShipmentSubscriber.php in src/EventSubscriber/ShipmentSubscriber.php

File

src/Event/ShipmentEvent.php, line 13

Namespace

Drupal\commerce_shipping\Event
View source
class ShipmentEvent extends EventBase {

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

  /**
   * Constructs a new ShipmentEvent.
   *
   * @param \Drupal\commerce_shipping\Entity\ShipmentInterface $shipment
   *   The shipment.
   */
  public function __construct(ShipmentInterface $shipment) {
    $this->shipment = $shipment;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
ShipmentEvent::$shipment protected property The shipment.
ShipmentEvent::getShipment public function Gets the shipment.
ShipmentEvent::__construct public function Constructs a new ShipmentEvent.