29 $this->metadataPool = $metadataPool;
38 $select = $this->resourceConnection->getConnection()->select();
39 $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
42 [
'product' => $this->resourceConnection->getTableName(
'catalog_product_entity')],
45 [
'bo' => $this->resourceConnection->getTableName(
'catalog_product_bundle_option')],
46 "bo.parent_id = product.$linkField",
49 [
'cis' => $this->resourceConnection->getTableName(
'cataloginventory_stock')],
51 [
'website_id',
'stock_id']
53 [
'bs' => $this->resourceConnection->getTableName(
'catalog_product_bundle_selection')],
54 'bs.option_id = bo.option_id',
58 'i.product_id = bs.product_id AND i.website_id = cis.website_id AND i.stock_id = cis.stock_id',
61 [
'e' => $this->resourceConnection->getTableName(
'catalog_product_entity')],
62 'e.entity_id = bs.product_id',
65 [
'product.entity_id',
'cis.website_id',
'cis.stock_id',
'bo.option_id']
66 )->columns([
'option_id' =>
'bo.option_id']);
__construct(\Magento\Framework\App\ResourceConnection $resourceConnection, \Magento\Framework\EntityManager\MetadataPool $metadataPool)