Пример #1
0
 /**
  * @param StoreFrontBundle\Struct\Category $category
  * @return array
  * @throws \Exception
  */
 public function convertCategoryStruct(StoreFrontBundle\Struct\Category $category)
 {
     $media = null;
     if ($category->getMedia()) {
         $media = $this->convertMediaStruct($category->getMedia());
     }
     $attribute = [];
     if ($category->hasAttribute('core')) {
         $attribute = $category->getAttribute('core')->toArray();
     }
     return ['id' => $category->getId(), 'parentId' => $category->getParentId(), 'name' => $category->getName(), 'position' => $category->getPosition(), 'metaKeywords' => $category->getMetaKeywords(), 'metaDescription' => $category->getMetaDescription(), 'cmsHeadline' => $category->getCmsHeadline(), 'cmsText' => $category->getCmsText(), 'active' => true, 'template' => $category->getTemplate(), 'productBoxLayout' => $category->getProductBoxLayout(), 'blog' => $category->isBlog(), 'path' => $category->getPath(), 'showFilterGroups' => $category->displayPropertySets(), 'external' => $category->getExternalLink(), 'hideFilter' => !$category->displayFacets(), 'hideTop' => !$category->displayInNavigation(), 'noViewSelect' => $category->allowViewSelect(), 'changed' => null, 'added' => null, 'attribute' => $attribute, 'attributes' => $category->getAttributes(), 'media' => $media, 'link' => $this->getCategoryLink($category)];
 }