You are here

interface ShippingMethodInterface in Commerce Shipping 8.2

Same name in this branch
  1. 8.2 src/Entity/ShippingMethodInterface.php \Drupal\commerce_shipping\Entity\ShippingMethodInterface
  2. 8.2 src/Plugin/Commerce/ShippingMethod/ShippingMethodInterface.php \Drupal\commerce_shipping\Plugin\Commerce\ShippingMethod\ShippingMethodInterface

Defines the base interface for shipping methods.

Hierarchy

Expanded class hierarchy of ShippingMethodInterface

All classes that implement ShippingMethodInterface

File

src/Plugin/Commerce/ShippingMethod/ShippingMethodInterface.php, line 15

Namespace

Drupal\commerce_shipping\Plugin\Commerce\ShippingMethod
View source
interface ShippingMethodInterface extends ConfigurableInterface, DependentPluginInterface, PluginFormInterface, PluginInspectionInterface, ParentEntityAwareInterface {

  /**
   * Gets the shipping method label.
   *
   * @return mixed
   *   The shipping method label.
   */
  public function getLabel();

  /**
   * Gets the default package type.
   *
   * @return \Drupal\commerce_shipping\Plugin\Commerce\PackageType\PackageTypeInterface
   *   The default package type.
   */
  public function getDefaultPackageType();

  /**
   * Gets the shipping services.
   *
   * @return \Drupal\commerce_shipping\ShippingService[]
   *   The shipping services.
   */
  public function getServices();

  /**
   * Gets the shipment workflow ID.
   *
   * @return string
   *   The shipment workflow ID.
   */
  public function getWorkflowId();

  /**
   * Calculates rates for the given shipment.
   *
   * @param \Drupal\commerce_shipping\Entity\ShipmentInterface $shipment
   *   The shipment.
   *
   * @return \Drupal\commerce_shipping\ShippingRate[]
   *   The rates.
   */
  public function calculateRates(ShipmentInterface $shipment);

  /**
   * Selects the given shipping rate for the given shipment.
   *
   * @param \Drupal\commerce_shipping\Entity\ShipmentInterface $shipment
   *   The shipment.
   * @param \Drupal\commerce_shipping\ShippingRate $rate
   *   The shipping rate.
   */
  public function selectRate(ShipmentInterface $shipment, ShippingRate $rate);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
ParentEntityAwareInterface::setParentEntity public function Sets the parent entity. 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
ShippingMethodInterface::calculateRates public function Calculates rates for the given shipment. 3
ShippingMethodInterface::getDefaultPackageType public function Gets the default package type. 1
ShippingMethodInterface::getLabel public function Gets the shipping method label. 1
ShippingMethodInterface::getServices public function Gets the shipping services. 1
ShippingMethodInterface::getWorkflowId public function Gets the shipment workflow ID. 1
ShippingMethodInterface::selectRate public function Selects the given shipping rate for the given shipment. 1