You are here

public function OrderItemProduct::getPurchasableEntities in Commerce Core 8.2

Gets the configured purchasable entities.

Return value

\Drupal\commerce\PurchasableEntityInterface[] An array of purchasable entities.

Overrides PurchasableEntityConditionInterface::getPurchasableEntities

File

modules/product/src/Plugin/Commerce/Condition/OrderItemProduct.php, line 109

Class

OrderItemProduct
Provides the product condition for order items.

Namespace

Drupal\commerce_product\Plugin\Commerce\Condition

Code

public function getPurchasableEntities() {
  if ($entity_ids = $this
    ->getPurchasableEntityIds()) {
    $storage = $this->entityTypeManager
      ->getStorage('commerce_product_variation');
    $entities = $storage
      ->loadMultiple($entity_ids);
  }
  return $entities ?? [];
}