예제 #1
0
파일: Type.php 프로젝트: rafaelstz/magento2
 /**
  * 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;
 }
예제 #2
0
 /**
  * @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;
 }