You are here

public function StockTransactionsInterface::getContext in Commerce Stock 8

Returns the active commerce context.

This is to support UI calls.

Parameters

\Drupal\commerce\PurchasableEntityInterface $entity: The purchasable entity (most likely a product variation entity).

Return value

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

Throws

\Exception

File

src/StockTransactionsInterface.php, line 34

Class

StockTransactionsInterface
Defines a common interface for creating stock transactions.

Namespace

Drupal\commerce_stock

Code

public function getContext(PurchasableEntityInterface $entity);