/** * @param bool $activeOnly if true, then only active categories will returned, otherwise all categories * * @return array|Category[] */ public function getCategories($activeOnly = Category::ACTIVE_ONLY) { return $this->categoryManager->getCategoryTree($activeOnly); }
public function __construct(CategoryManagerInterface $categoryManager, $ids) { $this->ids = $ids; $this->categories = $categoryManager->getCategories($ids, Category::ALL); }