You are here

public function LocalStockServiceConfig::getAvailabilityLocations in Commerce Stock 8

Get locations holding stock.

The locations should be filtered for the provided context and purchasable entity.

Parameters

\Drupal\commerce\Context $context: The context containing the customer & store.

\Drupal\commerce\PurchasableEntityInterface $entity: The purchasable entity.

Return value

\Drupal\commerce_stock\StockLocationInterface[] List of relevant locations.

Overrides StockServiceConfigInterface::getAvailabilityLocations

File

modules/local_storage/src/LocalStockServiceConfig.php, line 50

Class

LocalStockServiceConfig
The local stock service configuration class.

Namespace

Drupal\commerce_stock_local

Code

public function getAvailabilityLocations(Context $context, PurchasableEntityInterface $entity) {
  return $this->storage
    ->loadInContext($context, $entity);
}