public function findTreeItem($id, MapperTreeItemInterface $item)
    {
        if ($id === $item->getId()) {
            return $item;
        }
        foreach ($item->getChildren() as $child) {
            if (null !== $treeItem = $this->findTreeItem($id, $child)) {
                return $treeItem;
            }
        }

        return null;
    }
public function findTreeItem($id, MapperTreeItemInterface $item)
    {
        if ($id === $item->getId()) {
            return $item;
        }
        foreach ($item->getChildren() as $child) {
            if (null !== $treeItem = $this->findTreeItem($id, $child)) {
                return $treeItem;
            }
        }

        return null;
    }
public function findTreeItem ( $ id , MapperTreeItemInterface $ item ) { if ( $ id === $ item -> getId ( ) ) { return $ item ; } foreach ( $ item -> getChildren ( ) as $ child ) { if ( null !== $ treeItem = $ this -> findTreeItem ( $ id , $ child ) ) { return $ treeItem ; } } return null ; }
Find tree item by id.

@param string $id
@param MapperTreeItemInterface $item

@return null|MapperTreeItemInterface
Find tree item by id .