Bundle/MediaBundle/Helper/Menu/MenuBuilder.php
public function getCurrent()
    {
        if ($this->currentCache !== null) {
            return $this->currentCache;
        }
        /* @var $active MenuItem */
        $active = null;
        do {
            /* @var MenuItem[] $children */
            $children = $this->getChildren($active);
            $foundActiveChild = false;
            foreach ($children as $child) {
                if ($child->getActive()) {
                    $foundActiveChild = true;
                    $active = $child;
                    break;
                }
            }
        } while ($foundActiveChild);
        $this->currentCache = $active;

        return $active;
    }
public function getCurrent()
    {
        if ($this->currentCache !== null) {
            return $this->currentCache;
        }
        /* @var $active MenuItem */
        $active = null;
        do {
            /* @var MenuItem[] $children */
            $children = $this->getChildren($active);
            $foundActiveChild = false;
            foreach ($children as $child) {
                if ($child->getActive()) {
                    $foundActiveChild = true;
                    $active = $child;
                    break;
                }
            }
        } while ($foundActiveChild);
        $this->currentCache = $active;

        return $active;
    }
public function getCurrent ( ) { if ( $ this -> currentCache !== null ) { return $ this -> currentCache ; } /* @var $active MenuItem */ $ active = null ; do { /* @var MenuItem[] $children */ $ children = $ this -> getChildren ( $ active ) ; $ foundActiveChild = false ; foreach ( $ children as $ child ) { if ( $ child -> getActive ( ) ) { $ foundActiveChild = true ; $ active = $ child ; break ; } } } while ( $ foundActiveChild ) ; $ this -> currentCache = $ active ; return $ active ; }
Get current menu item.

@return MenuItem|null
Get current menu item .