You are here

class AlwaysInStock in Commerce Stock 8

The Checker and updater implementation for the always in stock service.

Hierarchy

Expanded class hierarchy of AlwaysInStock

File

src/AlwaysInStock.php, line 10

Namespace

Drupal\commerce_stock
View source
class AlwaysInStock implements StockCheckInterface, StockUpdateInterface {

  /**
   * {@inheritdoc}
   */
  public function createTransaction(PurchasableEntityInterface $entity, $location_id, $zone, $quantity, $unit_cost, $currency_code, $transaction_type_id, array $metadata) {

    // Do nothing and return a NULL value as its N/A.
    return NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getTotalStockLevel(PurchasableEntityInterface $entity, array $locations) {
    return PHP_INT_MAX;
  }

  /**
   * {@inheritdoc}
   */
  public function getIsInStock(PurchasableEntityInterface $entity, array $locations) {
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function getIsAlwaysInStock(PurchasableEntityInterface $entity) {
    return TRUE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AlwaysInStock::createTransaction public function Create a stock transaction. Overrides StockUpdateInterface::createTransaction
AlwaysInStock::getIsAlwaysInStock public function Check if entity is always in stock. Overrides StockCheckInterface::getIsAlwaysInStock
AlwaysInStock::getIsInStock public function Check if purchasable entity is in stock. Overrides StockCheckInterface::getIsInStock
AlwaysInStock::getTotalStockLevel public function Gets the stock level. Overrides StockCheckInterface::getTotalStockLevel