Sonata\ProductBundle\Entity\ProductCategoryManager::putInTree PHP Method

putInTree() protected method

Finds $category place in $tree.
protected putInTree ( Sonata\ClassificationBundle\Model\CategoryInterface $category, array &$tree )
$category Sonata\ClassificationBundle\Model\CategoryInterface
$tree array
    protected function putInTree(CategoryInterface $category, array &$tree)
    {
        if (null === $category->getParent()) {
            $tree[$category->getId()] = $category;
        } else {
            $this->putInTree($category->getParent(), $tree);
        }
    }