src/Tadcka/Mapper/Extension/Source/Tree/MapperTreeHelper.php
private function findRecursiveFullPath($itemId, MapperTreeItemInterface $tree)
    {
        foreach ($tree->getChildren() as $child) {
            if ($itemId === $child->getId()) {
                return [$itemId => $child->getTitle()];
            } else {
                $path = $this->findRecursiveFullPath($itemId, $child);
                if (0 < count($path)) {
                    $path[$child->getId()] = $child->getTitle();

                    return $path;
                }
            }
        }

        return [];
    }
private function findRecursiveFullPath($itemId, MapperTreeItemInterface $tree)
    {
        foreach ($tree->getChildren() as $child) {
            if ($itemId === $child->getId()) {
                return [$itemId => $child->getTitle()];
            } else {
                $path = $this->findRecursiveFullPath($itemId, $child);
                if (0 < count($path)) {
                    $path[$child->getId()] = $child->getTitle();

                    return $path;
                }
            }
        }

        return [];
    }
private function findRecursiveFullPath ( $ itemId , MapperTreeItemInterface $ tree ) { foreach ( $ tree -> getChildren ( ) as $ child ) { if ( $ itemId === $ child -> getId ( ) ) { return [ $ itemId => $ child -> getTitle ( ) ] ; } else { $ path = $ this -> findRecursiveFullPath ( $ itemId , $ child ) ; if ( 0 < count ( $ path ) ) { $ path [ $ child -> getId ( ) ] = $ child -> getTitle ( ) ; return $ path ; } } } return [ ] ; }
Find recursive full path.

@param string $itemId
@param MapperTreeItemInterface $tree

@return array
Find recursive full path .