Symfony\Cmf\Bundle\RoutingBundle\Model\Route::setPath PHP Method

setPath() public method

It is recommended to use setVariablePattern to just set the part after the static part. If you use this method, it will ensure that the static part is not changed and only change the variable part. When using PHPCR-ODM, make sure to persist the route before calling this to have the id field initialized.
public setPath ( $pattern )
    public function setPath($pattern)
    {
        $len = strlen($this->getStaticPrefix());
        if (strncmp($this->getStaticPrefix(), $pattern, $len)) {
            throw new \InvalidArgumentException('You can not set a pattern for the route that does not start with its current static prefix. First update the static prefix or directly use setVariablePattern.');
        }
        return $this->setVariablePattern(substr($pattern, $len));
    }