public function testValidate() { $this->_model->addData(["include_in_menu" => false, "is_active" => false, 'name' => 'test']); $this->assertNotEmpty($this->_model->validate()); }
/** * 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()]); }
/** * @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); } } }
/** * {@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); } }