本文整理汇总了PHP中Magento\Catalog\Test\Fixture\Category::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getData方法的具体用法?PHP Category::getData怎么用?PHP Category::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Test\Fixture\Category
的用法示例。
在下文中一共展示了Category::getData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareCategory
/**
* Prepare Category fixture with the updated data.
*
* @param Category $category
* @param Category $initialCategory
* @return Category
*/
protected function prepareCategory(Category $category, Category $initialCategory)
{
$parentCategory = $category->hasData('parent_id') ? $category->getDataFieldConfig('parent_id')['source']->getParentCategory() : $initialCategory->getDataFieldConfig('parent_id')['source']->getParentCategory();
$data = ['data' => array_merge($initialCategory->getData(), $category->getData(), ['parent_id' => ['source' => $parentCategory]])];
return $this->fixtureFactory->createByCode('category', $data);
}
示例2: prepareData
/**
* @param FixtureFactory $fixtureFactory
* @param Category $category
* @param Category $initialCategory
* @return array
*/
protected function prepareData(FixtureFactory $fixtureFactory, Category $category, Category $initialCategory)
{
$product = $fixtureFactory->createByCode('catalogProductSimple', ['dataset' => 'default', 'data' => ['category_ids' => ['category' => $initialCategory]]]);
$product->persist();
return array_merge($initialCategory->getData(), $category->getData());
}