Ejemplo n.º 1
0
 /**
  * Configure breadcrumbs for view
  * 
  * @param \Shop\Service\ProductEntity $product
  * @return void
  */
 private function configureBreadcrumbs(ProductEntity $product)
 {
     $keeper = $this->getCategoryIdKeeper();
     if ($keeper->hasLastCategoryId()) {
         // Set the last persisted category id
         $product->setCategoryId($keeper->getLastCategoryId(), ProductEntity::FILTER_INT);
         // Append breadcrumbs
         $this->view->getBreadcrumbBag()->add($this->getModuleService('productManager')->getBreadcrumbs($product));
     } else {
         // No last id? Then make sure no breadcrumbs displayed
         $this->view->getBreadcrumbBag()->clear();
     }
 }