src/Sulu/Bundle/AdminBundle/Navigation/NavigationItem.php
public function find($navigationItem)
    {
        $stack = [$this];
        while (!empty($stack)) {
            /** @var NavigationItem $item */
            $item = array_pop($stack);
            if ($item->equalsChildless($navigationItem)) {
                return $item;
            }
            foreach ($item->getChildren() as $child) {
                /* @var NavigationItem $child */
                $stack[] = $child;
            }
        }

        return;
    }
public function find($navigationItem)
    {
        $stack = [$this];
        while (!empty($stack)) {
            /** @var NavigationItem $item */
            $item = array_pop($stack);
            if ($item->equalsChildless($navigationItem)) {
                return $item;
            }
            foreach ($item->getChildren() as $child) {
                /* @var NavigationItem $child */
                $stack[] = $child;
            }
        }

        return;
    }
public function find ( $ navigationItem ) { $ stack = [ $ this ] ; while ( ! empty ( $ stack ) ) { /** @var NavigationItem $item */ $ item = array_pop ( $ stack ) ; if ( $ item -> equalsChildless ( $ navigationItem ) ) { return $ item ; } foreach ( $ item -> getChildren ( ) as $ child ) { /* @var NavigationItem $child */ $ stack [ ] = $ child ; } } return ; }
Searches for the equivalent of a specific NavigationItem.

@param NavigationItem $navigationItem The NavigationItem to look for

@return NavigationItem The item if it is found, otherwise false
Searches for the equivalent of a specific NavigationItem .