File: D:/HostingSpaces/SBogers10/topswtwmobile.komma.pro/app/KommaApp/Shop/Categories/CategoryService.php
<?php
namespace KommaApp\Shop\Categories;
use KommaApp\Shop\Tree\TreeService;
class CategoryService extends TreeService
{
/**
* @var CategoryRepository
*/
protected $categoryRepository;
public function __construct(CategoryRepository $categoryRepository)
{
$this->categoryRepository = $categoryRepository;
}
/**
* @param bool $withIndex
* @return array
*/
public function getTreeNodes($withIndex = true)
{
$nodes = $this->categoryRepository->getTreeNodes();
if( ! $withIndex) unset($nodes['index']);
return $nodes;
}
}