You are here

public function MenuPositionRule::getMenuLinkPlugin in Menu Position 8

Get the menu link plugin.

File

src/Entity/MenuPositionRule.php, line 251

Class

MenuPositionRule
Defines the MenuPositionRule entity.

Namespace

Drupal\menu_position\Entity

Code

public function getMenuLinkPlugin() {
  $menu_link = $this
    ->getMenuLink();
  if (!$menu_link || !$this
    ->menuLinkManager()
    ->hasDefinition($menu_link)) {
    return NULL;
  }
  return $this
    ->menuLinkManager()
    ->createInstance($menu_link);
}