interface StockServiceConfigInterface in Commerce Stock 8
The stock service configuration interface.
Hierarchy
- interface \Drupal\commerce_stock\StockServiceConfigInterface
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_stockView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StockServiceConfigInterface:: |
public | function | Get locations holding stock. | 2 |
StockServiceConfigInterface:: |
public | function | Get the location for automatic stock allocation. | 2 |