class AlwaysInStock in Commerce Stock 8
The Checker and updater implementation for the always in stock service.
Hierarchy
- class \Drupal\commerce_stock\AlwaysInStock implements StockCheckInterface, StockUpdateInterface
Expanded class hierarchy of AlwaysInStock
File
- src/
AlwaysInStock.php, line 10
Namespace
Drupal\commerce_stockView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AlwaysInStock:: |
public | function |
Create a stock transaction. Overrides StockUpdateInterface:: |
|
AlwaysInStock:: |
public | function |
Check if entity is always in stock. Overrides StockCheckInterface:: |
|
AlwaysInStock:: |
public | function |
Check if purchasable entity is in stock. Overrides StockCheckInterface:: |
|
AlwaysInStock:: |
public | function |
Gets the stock level. Overrides StockCheckInterface:: |