Elcodi\Store\ProductBundle\Services\StoreCategoryTree::formatCategoryTree PHP Method

formatCategoryTree() protected method

Formats a category tree to return it on a store friendly format.
protected formatCategoryTree ( array &$categoryTree ) : array
$categoryTree array The categories tree.
return array The formatted category tree
    protected function formatCategoryTree(array &$categoryTree)
    {
        $formattedCategoryTree = [];
        foreach ($categoryTree as $categoryNode) {
            if ($this->isCategoryEnabled($categoryNode['entity'])) {
                $formattedCategoryTree[] = $this->formatCategoryNode($categoryNode);
            }
        }
        return $formattedCategoryTree;
    }