interface StockCheckInterface in Commerce Stock 8
The stock checker interface.
Hierarchy
- interface \Drupal\commerce_stock\StockCheckInterface
Expanded class hierarchy of StockCheckInterface
All classes that implement StockCheckInterface
4 files declare their use of StockCheckInterface
- LocalStockChecker.php in modules/
local_storage/ src/ LocalStockChecker.php - LocalStockService.php in modules/
local_storage/ src/ LocalStockService.php - LocalStockServiceTest.php in modules/
local_storage/ tests/ src/ Kernel/ LocalStockServiceTest.php - LocalStockUpdater.php in modules/
local_storage/ src/ LocalStockUpdater.php
File
- src/
StockCheckInterface.php, line 10
Namespace
Drupal\commerce_stockView source
interface StockCheckInterface {
/**
* Gets the stock level.
*
* @param \Drupal\commerce\PurchasableEntityInterface $entity
* The purchasable entity.
* @param \Drupal\commerce_stock\StockLocationInterface[] $locations
* The locations.
*
* @return int
* The stock level.
*/
public function getTotalStockLevel(PurchasableEntityInterface $entity, array $locations);
/**
* Check if purchasable entity is in stock.
*
* @param \Drupal\commerce\PurchasableEntityInterface $entity
* The purchasable entity.
* @param \Drupal\commerce_stock\StockLocationInterface[] $locations
* The locations to check against.
*
* @return bool
* TRUE if the entity is in stock, FALSE otherwise.
*/
public function getIsInStock(PurchasableEntityInterface $entity, array $locations);
/**
* Check if entity is always in stock.
*
* @param \Drupal\commerce\PurchasableEntityInterface $entity
* The purchasable entity.
*
* @return bool
* TRUE if the entity is always in stock, FALSE otherwise.
*/
public function getIsAlwaysInStock(PurchasableEntityInterface $entity);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StockCheckInterface:: |
public | function | Check if entity is always in stock. | 2 |
StockCheckInterface:: |
public | function | Check if purchasable entity is in stock. | 2 |
StockCheckInterface:: |
public | function | Gets the stock level. | 2 |