AlwaysInStock.php in Commerce Stock 8
File
src/AlwaysInStock.php
View source
<?php
namespace Drupal\commerce_stock;
use Drupal\commerce\PurchasableEntityInterface;
class AlwaysInStock implements StockCheckInterface, StockUpdateInterface {
public function createTransaction(PurchasableEntityInterface $entity, $location_id, $zone, $quantity, $unit_cost, $currency_code, $transaction_type_id, array $metadata) {
return NULL;
}
public function getTotalStockLevel(PurchasableEntityInterface $entity, array $locations) {
return PHP_INT_MAX;
}
public function getIsInStock(PurchasableEntityInterface $entity, array $locations) {
return TRUE;
}
public function getIsAlwaysInStock(PurchasableEntityInterface $entity) {
return TRUE;
}
}
Classes
Name |
Description |
AlwaysInStock |
The Checker and updater implementation for the always in stock service. |