You are here

public function ProductBundle::getBundleItemIds in Commerce Product Bundle 8

Gets the bundle item IDs.

Return value

int[] The bundle item IDs.

Overrides BundleInterface::getBundleItemIds

2 calls to ProductBundle::getBundleItemIds()
ProductBundle::getBundleItemIndex in src/Entity/ProductBundle.php
Gets the index of the given bundle item.
ProductBundle::hasBundleItem in src/Entity/ProductBundle.php
Checks whether the bundle has a given bundle item.

File

src/Entity/ProductBundle.php, line 275

Class

ProductBundle
Defines the product bundle entity.

Namespace

Drupal\commerce_product_bundle\Entity

Code

public function getBundleItemIds() {
  $item_ids = [];
  foreach ($this
    ->get('bundle_items') as $field_item) {
    $item_ids[] = $field_item->target_id;
  }
  return $item_ids;
}