interface StockServiceManagerInterface in Commerce Stock 8
The stock service manager interface.
Hierarchy
- interface \Drupal\commerce_stock\StockServiceManagerInterface
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_stockView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StockServiceManagerInterface:: |
public | function | Adds a Stock service. | 1 |
StockServiceManagerInterface:: |
public | function | Get a service relevant for the entity. | 1 |
StockServiceManagerInterface:: |
public | function | Returns an array of the IDs of all registered stock services. | 1 |
StockServiceManagerInterface:: |
public | function | Returns an array of all registered stock services. | 1 |