getId() public method

public getId ( )
Example #1
0
 public function addCategory(Category $category)
 {
     $categoryId = $category->getId();
     if ($this->hasCategory($categoryId)) {
         throw new \Exception(sprintf('Category %s already exists', $categoryId));
     }
     $this->categories[$categoryId] = $category;
 }
Example #2
0
 public function buildPageMetadata(Category $category, Subcategory $subcategory, $widgetConfigs)
 {
     $ca = array('uniqueId' => $this->buildPageId($category->getId(), $subcategory->getId()), 'category' => $this->buildCategoryMetadata($category), 'subcategory' => $this->buildSubcategoryMetadata($subcategory), 'widgets' => array());
     foreach ($widgetConfigs as $config) {
         $ca['widgets'][] = $this->buildWidgetMetadata($config);
     }
     return $ca;
 }