/**
  * @param Struct\Product\Manufacturer $manufacturer
  * @param array $data
  */
 private function assignAttribute(Struct\Product\Manufacturer $manufacturer, array $data)
 {
     $attribute = $this->attributeHydrator->hydrate($this->extractFields('__manufacturerAttribute_', $data));
     $manufacturer->addAttribute('core', $attribute);
 }
 /**
  * @param StoreFrontBundle\Struct\Product\Manufacturer $manufacturer
  * @return array
  */
 public function convertManufacturerStruct(StoreFrontBundle\Struct\Product\Manufacturer $manufacturer)
 {
     $data = array('id' => $manufacturer->getId(), 'name' => $manufacturer->getName(), 'description' => $manufacturer->getDescription(), 'metaTitle' => $manufacturer->getMetaTitle(), 'metaDescription' => $manufacturer->getMetaDescription(), 'metaKeywords' => $manufacturer->getMetaKeywords(), 'link' => $manufacturer->getLink(), 'image' => $manufacturer->getCoverFile());
     $data['attribute'] = array();
     foreach ($manufacturer->getAttributes() as $attribute) {
         $data['attribute'] = array_merge($data['attribute'], $attribute->toArray());
     }
     return $data;
 }
Exemple #3
0
 /**
  * Converts the provided manufacturer to the category seo data structure.
  * Result can be merged with "sCategoryContent" to override relevant seo category data with
  * manufacturer data.
  *
  * @param Manufacturer $manufacturer
  * @return array
  */
 private function getSeoDataOfManufacturer(Manufacturer $manufacturer)
 {
     $content = array();
     $content['metaDescription'] = $manufacturer->getMetaDescription();
     $content['metaKeywords'] = $manufacturer->getMetaKeywords();
     $canonicalParams = array('sViewport' => 'listing', 'sAction' => 'manufacturer', 'sSupplier' => $manufacturer->getId());
     $content['canonicalParams'] = $canonicalParams;
     $path = $this->Front()->Router()->assemble($canonicalParams);
     if ($path) {
         /** @deprecated */
         $content['sSelfCanonical'] = $path;
     }
     $content['metaTitle'] = $manufacturer->getMetaTitle();
     $content['title'] = $manufacturer->getName();
     $content['canonicalTitle'] = $manufacturer->getName();
     return $content;
 }