You are here

public function LocalStockTransactionEvent::getEntity in Commerce Stock 8

Get the purchasable entity.

Return value

\Drupal\commerce\PurchasableEntityInterface The purchasable entity.

File

modules/local_storage/src/Event/LocalStockTransactionEvent.php, line 65

Class

LocalStockTransactionEvent
Defines the stock location event.

Namespace

Drupal\commerce_stock_local\Event

Code

public function getEntity() {
  $entityId = $this->stockTransaction['entity_id'];
  $entityType = $this->stockTransaction['entity_type'];
  return $this->entityTypeManager
    ->getStorage($entityType)
    ->load($entityId);
}