You are here

interface ShippingOrderManagerInterface in Commerce Shipping 8.2

Hierarchy

Expanded class hierarchy of ShippingOrderManagerInterface

All classes that implement ShippingOrderManagerInterface

6 files declare their use of ShippingOrderManagerInterface
CartSubscriber.php in src/EventSubscriber/CartSubscriber.php
OrderItemSubscriber.php in src/EventSubscriber/OrderItemSubscriber.php
OrderSubscriber.php in src/EventSubscriber/OrderSubscriber.php
ShipmentPromotionOfferBase.php in src/Plugin/Commerce/PromotionOffer/ShipmentPromotionOfferBase.php
Shipping.php in src/Plugin/Commerce/TaxType/Shipping.php

... See full list

File

src/ShippingOrderManagerInterface.php, line 8

Namespace

Drupal\commerce_shipping
View source
interface ShippingOrderManagerInterface {

  /**
   * Data key used to flag an order's shipments for repacking and calculation.
   */
  const FORCE_REFRESH = 'shipping_force_refresh';

  /**
   * Creates a shipping profile for the given order.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   * @param array $values
   *   (optional) An array of field values to set on the profile.
   *
   * @return \Drupal\profile\Entity\ProfileInterface
   *   A shipping profile.
   */
  public function createProfile(OrderInterface $order, array $values = []);

  /**
   * Gets the shipping profile for the given order.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   *
   * @return \Drupal\profile\Entity\ProfileInterface|null
   *   The shipping profile, or NULL if none found.
   */
  public function getProfile(OrderInterface $order);

  /**
   * Checks if the given order has shipments.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   *
   * @return bool
   *   TRUE if the order has shipments, FALSE otherwise.
   */
  public function hasShipments(OrderInterface $order);

  /**
   * Determines whether the order is shippable.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   *
   * @return bool
   *   TRUE if the order is shippable, FALSE otherwise.
   */
  public function isShippable(OrderInterface $order);

  /**
   * Packs the given order into shipments.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   * @param \Drupal\profile\Entity\ProfileInterface $profile
   *   The shipping profile.
   *
   * @return \Drupal\commerce_shipping\\Entity\ShipmentInterface[]
   *   The unsaved shipments.
   */
  public function pack(OrderInterface $order, ProfileInterface $profile = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
ShippingOrderManagerInterface::createProfile public function Creates a shipping profile for the given order. 1
ShippingOrderManagerInterface::FORCE_REFRESH constant Data key used to flag an order's shipments for repacking and calculation.
ShippingOrderManagerInterface::getProfile public function Gets the shipping profile for the given order. 1
ShippingOrderManagerInterface::hasShipments public function Checks if the given order has shipments. 1
ShippingOrderManagerInterface::isShippable public function Determines whether the order is shippable. 1
ShippingOrderManagerInterface::pack public function Packs the given order into shipments. 1