/**
  * @param \Magento\Catalog\Model\Category $category
  * @param boolean $recursive
  * @return \Magento\Catalog\Model\Category[]
  */
 public function getChildren(Category $category, $recursive = false)
 {
     return $category->isObjectNew() ? [] : $category->getResourceCollection()->addAttributeToSelect('url_path')->addAttributeToSelect('url_key')->addAttributeToSelect('name')->addIdFilter($this->getChildrenIds($category, $recursive));
 }
 /**
  * @param \Magento\Catalog\Model\Category $category
  * @return bool
  */
 protected function isNeedToGenerateUrlPathForParent($category)
 {
     return $category->isObjectNew() || $category->getLevel() >= self::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING;
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function isObjectNew($flag = null)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'isObjectNew');
     if (!$pluginInfo) {
         return parent::isObjectNew($flag);
     } else {
         return $this->___callPlugins('isObjectNew', func_get_args(), $pluginInfo);
     }
 }