You are here

class AlwaysInStockService in Commerce Stock 8

A stock service for always in stock products.

Hierarchy

Expanded class hierarchy of AlwaysInStockService

1 string reference to 'AlwaysInStockService'
commerce_stock.services.yml in ./commerce_stock.services.yml
commerce_stock.services.yml
1 service uses AlwaysInStockService
commerce_stock.always_in_stock_service in ./commerce_stock.services.yml
Drupal\commerce_stock\AlwaysInStockService

File

src/AlwaysInStockService.php, line 8

Namespace

Drupal\commerce_stock
View source
class AlwaysInStockService 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 AlwaysInStockService object.
   */
  public function __construct() {
    $this->stockChecker = new AlwaysInStock();
    $this->stockUpdater = $this->stockChecker;
    $this->stockServiceConfig = new StockServiceConfig();
  }

  /**
   * {@inheritdoc}
   */
  public function getName() {
    return 'Always in stock';
  }

  /**
   * {@inheritdoc}
   */
  public function getId() {
    return 'always_in_stock';
  }

  /**
   * {@inheritdoc}
   */
  public function getStockChecker() {
    return $this->stockChecker;
  }

  /**
   * {@inheritdoc}
   */
  public function getStockUpdater() {
    return $this->stockUpdater;
  }

  /**
   * {@inheritdoc}
   */
  public function getConfiguration() {
    return $this->stockServiceConfig;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AlwaysInStockService::$stockChecker protected property The stock checker.
AlwaysInStockService::$stockServiceConfig protected property The stock service configuration.
AlwaysInStockService::$stockUpdater protected property The stock updater.
AlwaysInStockService::getConfiguration public function Gets the stock Configuration. Overrides StockServiceInterface::getConfiguration
AlwaysInStockService::getId public function Gets the id of the service. Overrides StockServiceInterface::getId
AlwaysInStockService::getName public function Gets the name of the service. Overrides StockServiceInterface::getName
AlwaysInStockService::getStockChecker public function Gets the stock checker. Overrides StockServiceInterface::getStockChecker
AlwaysInStockService::getStockUpdater public function Gets the stock updater. Overrides StockServiceInterface::getStockUpdater
AlwaysInStockService::__construct public function Constructs a new AlwaysInStockService object.