Returns the Route object associated with this link, if any.
\Symfony\Component\Routing\Route|null The route object for this menu link, or NULL if there isn't one.
Overrides MenuLinkInterface::getRoute
public function getRoute() {
if (!$this->route_name) {
return NULL;
}
if (!$this->routeObject instanceof Route) {
$route_provider = drupal_container()
->get('router.route_provider');
$this->routeObject = $route_provider
->getRouteByName($this->route_name);
}
return $this->routeObject;
}