/** * Delete options and selections. * * @param array $productIds * * @return \Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType */ protected function deleteOptionsAndSelections($productIds) { $optionTable = $this->_resource->getTableName('catalog_product_bundle_option'); $optionValueTable = $this->_resource->getTableName('catalog_product_bundle_option_value'); $valuesIds = $this->connection->fetchAssoc($this->connection->select()->from(['bov' => $optionValueTable], ['value_id'])->joinLeft(['bo' => $optionTable], 'bo.option_id = bov.option_id', ['option_id'])->where('parent_id IN (?)', $productIds)); $this->connection->delete($optionTable, $this->connection->quoteInto('value_id IN (?)', array_keys($valuesIds))); $productIdsInWhere = $this->connection->quoteInto('parent_id IN (?)', $productIds); $this->connection->delete($optionTable, $this->connection->quoteInto('parent_id IN (?)', $productIdsInWhere)); $this->connection->delete($optionTable, $this->connection->quoteInto('parent_product_id IN (?)', $productIdsInWhere)); return $this; }
/** * {@inheritdoc} */ public function execute(Select $select) { return $this->connection->fetchAssoc($select); }