/**
* Helper method for ::getActiveTrailIds().
*/
protected function doGetActiveTrailIds($menu_name) { // Parent ids; used both as key and value to ensure uniqueness.
// We always want all the top-level links with parent == ''.
$active_trail =
['' => ''
];
// If a link in the given menu indeed matches the route, then use it to
// complete the active trail.
if ($active_link =
$this->
getActiveLink($menu_name)) { if ($parents =
$this->menuLinkManager->
getParentIds($active_link->
getPluginId())) { $active_trail =
$parents +
$active_trail;
} } return $active_trail;
} /**
* {@inheritdoc}
*/
public function getActiveLink($menu_name = NULL
) {