public function generateAutoNodeRoute(RoutableNodeInterface $node)
    {

        $repository = $this->manager->getRepository(AutoNodeRoute::class);

        $route = (new AutoNodeRoute())
            ->setRoute('/' . $this->slugify($node));

        //$node->addRoute($route);


        /**
         * @var Node $parent
         */
        while (!is_null($parent = $node->getParent())) {
            $route->setRoute($this->getAutoNodeRoute($parent) . $route->getRoute());
            $node = $parent;
        }

        // add increment if route exists
        $route->setRoute(
            $route->getRoute().$this->getIncrement($route->getRoute())
        );


        //var_dump($route->getRoute());

        return $route;
    }
public function generateAutoNodeRoute(RoutableNodeInterface $node)
    {

        $repository = $this->manager->getRepository(AutoNodeRoute::class);

        $route = (new AutoNodeRoute())
            ->setRoute('/' . $this->slugify($node));

        //$node->addRoute($route);


        /**
         * @var Node $parent
         */
        while (!is_null($parent = $node->getParent())) {
            $route->setRoute($this->getAutoNodeRoute($parent) . $route->getRoute());
            $node = $parent;
        }

        // add increment if route exists
        $route->setRoute(
            $route->getRoute().$this->getIncrement($route->getRoute())
        );


        //var_dump($route->getRoute());

        return $route;
    }
public function generateAutoNodeRoute ( RoutableNodeInterface $ node ) { $ repository = $ this -> manager -> getRepository ( AutoNodeRoute :: class ) ; $ route = ( new AutoNodeRoute ( ) ) -> setRoute ( '/' . $ this -> slugify ( $ node ) ) ; //$node->addRoute($route); /**
         * @var Node $parent
         */ while ( ! is_null ( $ parent = $ node -> getParent ( ) ) ) { $ route -> setRoute ( $ this -> getAutoNodeRoute ( $ parent ) . $ route -> getRoute ( ) ) ; $ node = $ parent ; } // add increment if route exists $ route -> setRoute ( $ route -> getRoute ( ) . $ this -> getIncrement ( $ route -> getRoute ( ) ) ) ; //var_dump($route->getRoute()); return $ route ; }
generates a AutoNodeRoute for a given Node

@param RoutableNodeInterface $node
@return AutoNodeRoute
generates a AutoNodeRoute for a given Node