public function sCategoryPath($category) { $parts = $this->repository->getPathById($category, 'name'); $level = $this->baseCategory->getLevel() + 1; $parts = array_slice($parts, $level); return $parts; }
/** * Returns the category path for the given category id * * @param int|$id * @param int|null $parentId * @return array */ public function sGetCategoryPath($id, $parentId = null) { if ($parentId === null) { $parentId = $this->baseId; } $path = $this->repository->getPathById($id, 'id'); foreach ($path as $key => $value) { unset($path[$key]); if ($value == $parentId) { break; } } return $path; }