Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route::setName PHP Method

setName() public method

Note that this will change the URL this route matches.
public setName ( string $name ) : self
$name string the new name
return self
    public function setName($name)
    {
        $this->name = $name;
        return $this;
    }

Usage Example

 /**
  * Load data fixtures with the passed EntityManager
  *
  * @param ObjectManager|DocumentManager $manager
  */
 public function load(ObjectManager $manager)
 {
     $contentParent = $manager->find(null, '/cms/content');
     $routeParent = $manager->find(null, '/cms/routes/en/services');
     $menuBase = $manager->find(null, '/cms/menu/footer');
     $content = new DemoSeoContent();
     $content->setParentDocument($contentParent);
     $content->setName('seo-service');
     $content->setTitle('SEO Service');
     $content->setBody('A page about SEO service');
     $metaData = new SeoMetadata();
     $metaData->setMetaDescription('Description in Metadata');
     $content->setSeoMetadata($metaData);
     $manager->persist($content);
     $manager->bindTranslation($content, 'en');
     $contentRoute = new Route();
     $contentRoute->setParentDocument($routeParent);
     $contentRoute->setName('seo-service');
     $contentRoute->setContent($content);
     $manager->persist($contentRoute);
     $menuNode = new MenuNode();
     $menuNode->setParentDocument($menuBase);
     $menuNode->setName('seo-service');
     $menuNode->setLabel('SEO Services');
     $menuNode->setContent($content);
     $manager->persist($menuNode);
     $manager->flush();
 }
All Usage Examples Of Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route::setName