本文整理汇总了PHP中Magento\Catalog\Model\Category::addData方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::addData方法的具体用法?PHP Category::addData怎么用?PHP Category::addData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Model\Category
的用法示例。
在下文中一共展示了Category::addData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testValidate
public function testValidate()
{
$this->_model->addData(["include_in_menu" => false, "is_active" => false, 'name' => 'test']);
$this->assertNotEmpty($this->_model->validate());
}
示例2: updateCategoryUrlForStore
/**
* Override url key and url path for category in specific Store
*
* @param int $storeId
* @return void
*/
protected function updateCategoryUrlForStore($storeId)
{
$category = $this->categoryRepository->get($this->category->getId(), $storeId);
$this->category->addData(['url_key' => $category->getUrlKey(), 'url_path' => $category->getUrlPath()]);
}
示例3: setAdditionalData
/**
* @param array $row
* @param \Magento\Catalog\Model\Category $category
* @return void
*/
protected function setAdditionalData($row, $category)
{
$additionalAttributes = ['position', 'display_mode', 'page_layout', 'custom_layout_update'];
foreach ($additionalAttributes as $categoryAttribute) {
if (!empty($row[$categoryAttribute])) {
$attributeData = [$categoryAttribute => $row[$categoryAttribute]];
$category->addData($attributeData);
}
}
}
示例4: addData
/**
* {@inheritdoc}
*/
public function addData(array $arr)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'addData');
if (!$pluginInfo) {
return parent::addData($arr);
} else {
return $this->___callPlugins('addData', func_get_args(), $pluginInfo);
}
}