You are here

public function MenuItemExtrasMenuLinkContent::getUrlObject in Menu Item Extras 8.2

Gets the url object pointing to the URL of the menu link content entity.

Return value

\Drupal\Core\Url A Url object instance.

Overrides MenuLinkContent::getUrlObject

File

src/Entity/MenuItemExtrasMenuLinkContent.php, line 30

Class

MenuItemExtrasMenuLinkContent

Namespace

Drupal\menu_item_extras\Entity

Code

public function getUrlObject() {
  if (!$this->link
    ->first()) {
    return Url::fromRoute($this->route_name);
  }
  return parent::getUrlObject();
}