/** * Check availability of adding child Category * * @return boolean */ public function canAddChildCategory() { $options = new \Magento\Framework\DataObject(['is_allow' => true]); $this->_eventManager->dispatch('adminhtml_mageplaza_blog_category_tree_can_add_child_category', ['category' => $this->getCategory(), 'options' => $options]); return $options->getIsAllow(); }
/** * Check availability of adding sub category * * @return boolean */ public function canAddSubCategory() { $options = new \Magento\Framework\DataObject(['is_allow' => true]); $this->_eventManager->dispatch('adminhtml_catalog_category_tree_can_add_sub_category', ['category' => $this->getCategory(), 'options' => $options, 'store' => $this->getStore()->getId()]); return $options->getIsAllow(); }