public function __construct(MenuLinkTreeInterface
$menu_link_tree, EntityTypeManagerInterface
$entity_type_manager, TranslationInterface
$string_translation) { $this->menuLinkTree =
$menu_link_tree;
$this->entityTypeManager =
$entity_type_manager;
$this->stringTranslation =
$string_translation;
} /**
* {@inheritdoc}
*/
public function getParentSelectOptions($id = '', array
$menus = NULL, CacheableMetadata &
$cacheability = NULL
) { if (!
isset($menus)) { $menus =
$this->
getMenuOptions();
} $options =
[];
$depth_limit =
$this->
getParentDepthLimit($id);
foreach ($menus as $menu_name =>
$menu_title) { $options[$menu_name . ':'
] = '<' .
$menu_title . '>';
$parameters =
new MenuTreeParameters();
$parameters->
setMaxDepth($depth_limit);
$tree =
$this->menuLinkTree->
load($menu_name,
$parameters);
$manipulators =
[ [