src/Kunstmaan/NodeBundle/Helper/Menu/PageMenuAdaptor.php
private function getActiveNodeIds($request)
    {
        if (null === $this->activeNodeIds) {
            if (stripos($request->attributes->get('_route'), 'KunstmaanNodeBundle_nodes_edit') === 0) {
                $repo = $this->em->getRepository('KunstmaanNodeBundle:Node');

                $currentNode = $repo->findOneById($request->attributes->get('id'));
                $parentNodes = $repo->getAllParents($currentNode);
                $this->activeNodeIds = [];
                foreach ($parentNodes as $parentNode) {
                    $this->activeNodeIds[] = $parentNode->getId();
                }
            }
        }

        return is_null($this->activeNodeIds) ? [] : $this->activeNodeIds;
    }
private function getActiveNodeIds($request)
    {
        if (null === $this->activeNodeIds) {
            if (stripos($request->attributes->get('_route'), 'KunstmaanNodeBundle_nodes_edit') === 0) {
                $repo = $this->em->getRepository('KunstmaanNodeBundle:Node');

                $currentNode = $repo->findOneById($request->attributes->get('id'));
                $parentNodes = $repo->getAllParents($currentNode);
                $this->activeNodeIds = [];
                foreach ($parentNodes as $parentNode) {
                    $this->activeNodeIds[] = $parentNode->getId();
                }
            }
        }

        return is_null($this->activeNodeIds) ? [] : $this->activeNodeIds;
    }
private function getActiveNodeIds ( $ request ) { if ( null === $ this -> activeNodeIds ) { if ( stripos ( $ request -> attributes -> get ( '_route' ) , 'KunstmaanNodeBundle_nodes_edit' ) === 0 ) { $ repo = $ this -> em -> getRepository ( 'KunstmaanNodeBundle:Node' ) ; $ currentNode = $ repo -> findOneById ( $ request -> attributes -> get ( 'id' ) ) ; $ parentNodes = $ repo -> getAllParents ( $ currentNode ) ; $ this -> activeNodeIds = [ ] ; foreach ( $ parentNodes as $ parentNode ) { $ this -> activeNodeIds [ ] = $ parentNode -> getId ( ) ; } } } return is_null ( $ this -> activeNodeIds ) ? [ ] : $ this -> activeNodeIds ; }
Get an array with the id's off all nodes in the tree that should be
expanded.

@param $request

@return array
Get an array with the id s off all nodes in the tree that should be expanded .