You are here

interface StockCheckInterface in Commerce Stock 8

The stock checker interface.

Hierarchy

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_stock
View 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

Namesort descending Modifiers Type Description Overrides
StockCheckInterface::getIsAlwaysInStock public function Check if entity is always in stock. 2
StockCheckInterface::getIsInStock public function Check if purchasable entity is in stock. 2
StockCheckInterface::getTotalStockLevel public function Gets the stock level. 2