You are here

interface StockServiceConfigInterface in Commerce Stock 8

The stock service configuration interface.

Hierarchy

Expanded class hierarchy of StockServiceConfigInterface

All classes that implement StockServiceConfigInterface

3 files declare their use of StockServiceConfigInterface
LocalStockService.php in modules/local_storage/src/LocalStockService.php
LocalStockServiceConfig.php in modules/local_storage/src/LocalStockServiceConfig.php
LocalStockServiceTest.php in modules/local_storage/tests/src/Kernel/LocalStockServiceTest.php

File

src/StockServiceConfigInterface.php, line 11

Namespace

Drupal\commerce_stock
View source
interface StockServiceConfigInterface {

  /**
   * Get the location for automatic stock allocation.
   *
   * This is normally a designated location to act as the main warehouse.
   * This can also be a location worked out in realtime using the provided
   * context (order & customer), entity and the quantity requested.
   *
   * @param \Drupal\commerce\Context $context
   *   The context containing the customer & store.
   * @param \Drupal\commerce\PurchasableEntityInterface $entity
   *   The purchasable entity.
   * @param int $quantity
   *   The quantity.
   *
   * @return \Drupal\commerce_stock\StockLocationInterface
   *   The stock location.
   */
  public function getTransactionLocation(Context $context, PurchasableEntityInterface $entity, $quantity);

  /**
   * Get locations holding stock.
   *
   * The locations should be filtered for the provided context and purchasable
   * entity.
   *
   * @param \Drupal\commerce\Context $context
   *   The context containing the customer & store.
   * @param \Drupal\commerce\PurchasableEntityInterface $entity
   *   The purchasable entity.
   *
   * @return \Drupal\commerce_stock\StockLocationInterface[]
   *   List of relevant locations.
   */
  public function getAvailabilityLocations(Context $context, PurchasableEntityInterface $entity);

}

Members

Namesort descending Modifiers Type Description Overrides
StockServiceConfigInterface::getAvailabilityLocations public function Get locations holding stock. 2
StockServiceConfigInterface::getTransactionLocation public function Get the location for automatic stock allocation. 2