You are here

interface StockServiceManagerInterface in Commerce Stock 8

The stock service manager interface.

Hierarchy

Expanded class hierarchy of StockServiceManagerInterface

All classes that implement StockServiceManagerInterface

2 files declare their use of StockServiceManagerInterface
OrderEventSubscriber.php in src/EventSubscriber/OrderEventSubscriber.php
StockConfigForm.php in src/Form/StockConfigForm.php

File

src/StockServiceManagerInterface.php, line 10

Namespace

Drupal\commerce_stock
View source
interface StockServiceManagerInterface {

  /**
   * Adds a Stock service.
   *
   * @param \Drupal\commerce_stock\StockServiceInterface $stock_service
   *   The stock service.
   */
  public function addService(StockServiceInterface $stock_service);

  /**
   * Get a service relevant for the entity.
   *
   * @param \Drupal\commerce\PurchasableEntityInterface $entity
   *   The purchasable entity (most likely a product variation entity).
   *
   * @return \Drupal\commerce_stock\StockServiceInterface
   *   The appropriate stock service for the given purchasable entity.
   */
  public function getService(PurchasableEntityInterface $entity);

  /**
   * Returns an array of all registered stock services.
   *
   * @return \Drupal\commerce_stock\StockServiceInterface[]
   *   All registered stock services keyed by service ID.
   */
  public function listServices();

  /**
   * Returns an array of the IDs of all registered stock services.
   *
   * @return array
   *   Array of the IDs of all registered stock services.
   *   Format is: array('service key' => 'service name')
   */
  public function listServiceIds();

}

Members

Namesort descending Modifiers Type Description Overrides
StockServiceManagerInterface::addService public function Adds a Stock service. 1
StockServiceManagerInterface::getService public function Get a service relevant for the entity. 1
StockServiceManagerInterface::listServiceIds public function Returns an array of the IDs of all registered stock services. 1
StockServiceManagerInterface::listServices public function Returns an array of all registered stock services. 1