当前位置: 首页>>代码示例>>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;未经允许,请勿转载。