EventListener/AutoNodeRouteUpdateListener.php
public function prePersist(LifecycleEventArgs $args)
    {

        // update child routes
        $entity = $args->getEntity();

        if (    $entity instanceof RoutableNodeInterface
            &&  $entity->hasAutoNodeRouteGeneration()
        ) {
            $routeManager = $this->container->get('mm_cmf_routing.node_route_manager');
            $entity->addRoute($routeManager->generateAutoNodeRoute($entity));
        }

        return;
    }
public function prePersist(LifecycleEventArgs $args)
    {

        // update child routes
        $entity = $args->getEntity();

        if (    $entity instanceof RoutableNodeInterface
            &&  $entity->hasAutoNodeRouteGeneration()
        ) {
            $routeManager = $this->container->get('mm_cmf_routing.node_route_manager');
            $entity->addRoute($routeManager->generateAutoNodeRoute($entity));
        }

        return;
    }
public function prePersist ( LifecycleEventArgs $ args ) { // update child routes $ entity = $ args -> getEntity ( ) ; if ( $ entity instanceof RoutableNodeInterface && $ entity -> hasAutoNodeRouteGeneration ( ) ) { $ routeManager = $ this -> container -> get ( 'mm_cmf_routing.node_route_manager' ) ; $ entity -> addRoute ( $ routeManager -> generateAutoNodeRoute ( $ entity ) ) ; } return ; }
prePersist Event
whenever a new Node is created, also create automatically a new NodeRoute

@param LifecycleEventArgs $args
prePersist Event whenever a new Node is created also create automatically a new NodeRoute