class ProductBundleStockProxyService in Commerce Product Bundle 8
A stock service for always in stock products.
Hierarchy
- class \Drupal\commerce_product_bundle_stock\ProductBundleStockProxyService implements StockServiceInterface
Expanded class hierarchy of ProductBundleStockProxyService
1 string reference to 'ProductBundleStockProxyService'
- commerce_product_bundle_stock.services.yml in modules/
commerce_product_bundle_stock/ commerce_product_bundle_stock.services.yml - modules/commerce_product_bundle_stock/commerce_product_bundle_stock.services.yml
1 service uses ProductBundleStockProxyService
- commerce_product_bundle.stock_proxy_service in modules/
commerce_product_bundle_stock/ commerce_product_bundle_stock.services.yml - Drupal\commerce_product_bundle_stock\ProductBundleStockProxyService
File
- modules/
commerce_product_bundle_stock/ src/ ProductBundleStockProxyService.php, line 11
Namespace
Drupal\commerce_product_bundle_stockView source
class ProductBundleStockProxyService implements StockServiceInterface {
/**
* The stock checker.
*
* @var \Drupal\commerce_stock\StockCheckInterface
*/
protected $stockChecker;
/**
* The stock updater.
*
* @var \Drupal\commerce_stock\StockUpdateInterface
*/
protected $stockUpdater;
/**
* The stock service configuration.
*
* @var \Drupal\commerce_stock\StockServiceConfigInterface
*/
protected $stockServiceConfig;
/**
* Constructs a new ProductBundleStockProxyService object.
*/
public function __construct() {
// The service manager is not injected into the constructor because the
// it needs to load before being used here.
$stock_service_manager = \Drupal::service('commerce_stock.service_manager');
$this->stockChecker = new ProductBundleStockProxy($stock_service_manager);
$this->stockUpdater = $this->stockChecker;
$this->stockServiceConfig = new StockServiceConfig($this->stockChecker);
}
/**
* {@inheritdoc}
*/
public function getName() {
return 'Product bundle stock proxy service';
}
/**
* {@inheritdoc}
*/
public function getId() {
return 'commerce_product_bundle_stock';
}
/**
* {@inheritdoc}
*/
public function getStockChecker() {
return $this->stockChecker;
}
/**
* {@inheritdoc}
*/
public function getStockUpdater() {
return $this->stockUpdater;
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return $this->stockServiceConfig;
}
}