protected function ProductBundle::getBundleItemIndex in Commerce Product Bundle 8
Gets the index of the given bundle item.
Parameters
\Drupal\commerce_product_bundle\Entity\BundleItemInterface $bundle_item: The bundle item.
Return value
int|bool The index of the given bundle item, or FALSE if not found.
1 call to ProductBundle::getBundleItemIndex()
- ProductBundle::removeBundleItem in src/
Entity/ ProductBundle.php - Removes a bundle item.
File
- src/
Entity/ ProductBundle.php, line 254
Class
- ProductBundle
- Defines the product bundle entity.
Namespace
Drupal\commerce_product_bundle\EntityCode
protected function getBundleItemIndex(BundleItemInterface $bundle_item) {
return array_search($bundle_item
->id(), $this
->getBundleItemIds());
}