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

setName() public method

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

Usage Example

Ejemplo n.º 1
0
 public function load(ObjectManager $manager)
 {
     NodeHelper::createPath($manager->getPhpcrSession(), '/test');
     $root = $manager->find(null, '/test');
     $parent = new Generic();
     $parent->setParent($root);
     $parent->setNodename('routing');
     $manager->persist($parent);
     $route = new Route();
     $route->setParentDocument($parent);
     $route->setName('route-1');
     $manager->persist($route);
     $redirectRoute = new RedirectRoute();
     $redirectRoute->setParentDocument($parent);
     $redirectRoute->setName('redirect-route-1');
     $manager->persist($redirectRoute);
     $manager->flush();
 }