string $name ignored:
array $parameters must either contain the field 'route' with a: RouteObjectInterface or the field 'content_id' with a document id to get the route for (implementing RouteAwareInterface)
RouteNotFoundException If there is no such route in the database
Overrides ProviderBasedGenerator::generate
public function generate($name, $parameters = array(), $absolute = false) {
if ($name instanceof SymfonyRoute) {
$route = $this
->getBestLocaleRoute($name, $parameters);
}
elseif (is_string($name) && $name) {
$route = $this
->getRouteByName($name, $parameters);
}
else {
$route = $this
->getRouteByContent($name, $parameters);
}
if (!$route instanceof SymfonyRoute) {
$hint = is_object($route) ? get_class($route) : gettype($route);
throw new RouteNotFoundException('Route of this document is not an instance of Symfony\\Component\\Routing\\Route but: ' . $hint);
}
$this
->unsetLocaleIfNotNeeded($route, $parameters);
return parent::generate($route, $parameters, $absolute);
}