當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CatalogProductSimple::getData方法代碼示例

本文整理匯總了PHP中Magento\Catalog\Test\Fixture\CatalogProductSimple::getData方法的典型用法代碼示例。如果您正苦於以下問題:PHP CatalogProductSimple::getData方法的具體用法?PHP CatalogProductSimple::getData怎麽用?PHP CatalogProductSimple::getData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Catalog\Test\Fixture\CatalogProductSimple的用法示例。


在下文中一共展示了CatalogProductSimple::getData方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: prepareProduct

 /**
  * Prepare product data.
  *
  * @param CatalogProductSimple $product
  * @param CatalogProductAttribute $attribute
  * @param CatalogAttributeSet $attributeSet
  * @return CatalogProductSimple
  */
 protected function prepareProduct($product, $attribute, $attributeSet)
 {
     $data = ['attribute_set_id' => ['attribute_set' => $attributeSet], 'custom_attribute' => $attribute];
     $data = array_merge($data, $product->getData());
     return $this->fixtureFactory->createByCode('catalogProductSimple', ['data' => $data]);
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:14,代碼來源:UpdateProductAttributeEntityTest.php

示例2: prepareFixtureData

 /**
  * Preparation of fixture data before comparing
  *
  * @param CatalogProductSimple $productSearch
  * @return array
  */
 protected function prepareFixtureData(CatalogProductSimple $productSearch)
 {
     $compareData = [];
     foreach ($productSearch->getData() as $key => $value) {
         if ($key === 'price') {
             if (isset($value['price_from'])) {
                 $compareData[$key][] = $value['price_from'];
             }
             if (isset($value['price_to'])) {
                 $compareData[$key][] = $value['price_to'];
             }
         } else {
             $index = isset($this->placeholder[$key]) ? $this->placeholder[$key] : $key;
             $compareData[$index][] = $value;
         }
     }
     unset($compareData['url_key']);
     return $compareData;
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:25,代碼來源:AssertAdvancedSearchProductsResult.php

示例3: test

 /**
  * Run mass update product simple entity test.
  *
  * @param CatalogProductSimple $initialProduct
  * @param CatalogProductSimple $product
  * @param string $configData
  * @return array
  */
 public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product, $configData)
 {
     $this->configData = $configData;
     // Preconditions
     $initialProduct->persist();
     $this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $configData])->run();
     // Steps
     $this->productGrid->open();
     $this->productGrid->getProductGrid()->updateAttributes([['sku' => $initialProduct->getSku()]]);
     $this->attributeMassActionPage->getAttributesBlockForm()->fill($product);
     $this->attributeMassActionPage->getFormPageActions()->save();
     $data = array_merge($initialProduct->getData(), $product->getData());
     $product = $this->objectManager->create('Magento\\Catalog\\Test\\Fixture\\CatalogProductSimple', ['data' => $data]);
     return ['category' => $initialProduct->getDataFieldConfig('category_ids')['source']->getCategories()[0], 'product' => $product];
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:23,代碼來源:MassProductUpdateTest.php


注:本文中的Magento\Catalog\Test\Fixture\CatalogProductSimple::getData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。