ProductBundleStockProxyService.php in Commerce Product Bundle 8
File
modules/commerce_product_bundle_stock/src/ProductBundleStockProxyService.php
View source
<?php
namespace Drupal\commerce_product_bundle_stock;
use Drupal\commerce_stock\StockServiceConfig;
use Drupal\commerce_stock\StockServiceInterface;
class ProductBundleStockProxyService implements StockServiceInterface {
protected $stockChecker;
protected $stockUpdater;
protected $stockServiceConfig;
public function __construct() {
$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);
}
public function getName() {
return 'Product bundle stock proxy service';
}
public function getId() {
return 'commerce_product_bundle_stock';
}
public function getStockChecker() {
return $this->stockChecker;
}
public function getStockUpdater() {
return $this->stockUpdater;
}
public function getConfiguration() {
return $this->stockServiceConfig;
}
}