Service/CategoryService.php
private function buildChildNode($node, $references, $maxLevel)
    {
        if (isset($references[$node->getParentId()])) {
            $level = $references[$node->getParentId()]->getLevel() + 1;

            // Check if max level is not reached or not set at all.
            if ($maxLevel == 0 || $level <= $maxLevel) {
                $node->setLevel($level);
                $node->setParent($references[$node->getParentId()]);
                $references[$node->getParentId()]->setChild($node, $node->getId());
            }
        }
    }
private function buildChildNode($node, $references, $maxLevel)
    {
        if (isset($references[$node->getParentId()])) {
            $level = $references[$node->getParentId()]->getLevel() + 1;

            // Check if max level is not reached or not set at all.
            if ($maxLevel == 0 || $level <= $maxLevel) {
                $node->setLevel($level);
                $node->setParent($references[$node->getParentId()]);
                $references[$node->getParentId()]->setChild($node, $node->getId());
            }
        }
    }
private function buildChildNode ( $ node , $ references , $ maxLevel ) { if ( isset ( $ references [ $ node -> getParentId ( ) ] ) ) { $ level = $ references [ $ node -> getParentId ( ) ] -> getLevel ( ) + 1 ; // Check if max level is not reached or not set at all. if ( $ maxLevel == 0 || $ level <= $ maxLevel ) { $ node -> setLevel ( $ level ) ; $ node -> setParent ( $ references [ $ node -> getParentId ( ) ] ) ; $ references [ $ node -> getParentId ( ) ] -> setChild ( $ node , $ node -> getId ( ) ) ; } } }
Builds a child node.

@param AbstractCategoryDocument $node
@param \ArrayIterator           $references
@param int                      $maxLevel
Builds a child node .