HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/topswtw.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;
    }
}