コード例 #1
0
ファイル: Data.php プロジェクト: pavelnovitsky/magento2
 /**
  * Generate category url key path
  *
  * @param \Magento\Catalog\Model\Category $category
  * @return string
  */
 public function generateCategoryUrlKeyPath($category)
 {
     $parentPath = $this->categoryHelper->getCategoryUrlPath('', true, $category->getStoreId());
     $urlKey = $category->getUrlKey() == '' ? $category->formatUrlKey($category->getName()) : $category->formatUrlKey($category->getUrlKey());
     return $parentPath . $urlKey;
 }
コード例 #2
0
 /**
  * Generate category url key
  *
  * @param \Magento\Catalog\Model\Category $category
  * @return string
  */
 public function generateUrlKey($category)
 {
     $urlKey = $category->getUrlKey();
     return $category->formatUrlKey($urlKey === '' || $urlKey === null ? $category->getName() : $urlKey);
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function getUrlKey()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getUrlKey');
     if (!$pluginInfo) {
         return parent::getUrlKey();
     } else {
         return $this->___callPlugins('getUrlKey', func_get_args(), $pluginInfo);
     }
 }