/** * Retrieve additional searchable data from type instance * Using based on product id and store_id data * * @param \Magento\Catalog\Model\Product $product * @return array */ public function getSearchableData($product) { $searchData = parent::getSearchableData($product); $optionSearchData = $this->_bundleOption->create()->getSearchableData($product->getId(), $product->getStoreId()); if ($optionSearchData) { $searchData = array_merge($searchData, $optionSearchData); } return $searchData; }
/** * @param Option $option * @param OptionModel $optionModel * @return OptionModel */ public function getModelFromData(Option $option, OptionModel $optionModel) { $newOptionModel = $this->optionFactory->create(); $newOptionModel->setData($optionModel->getData())->addData($option->__toArray())->setId($optionModel->getId())->setDefaultTitle(is_null($option->getTitle()) ? $optionModel->getTitle() : $option->getTitle()); return $newOptionModel; }