function MenuUiHooks::formNodeTypeFormBuilder

Same name and namespace in other branches
  1. 11.x core/modules/menu_ui/src/Hook/MenuUiHooks.php \Drupal\menu_ui\Hook\MenuUiHooks::formNodeTypeFormBuilder()

Entity builder for the node type form with menu options.

See also

\Drupal\menu_ui\Hook\MenuUiHooks::formNodeTypeFormAlter()

File

core/modules/menu_ui/src/Hook/MenuUiHooks.php, line 404

Class

MenuUiHooks
Hook implementations for menu_ui.

Namespace

Drupal\menu_ui\Hook

Code

public function formNodeTypeFormBuilder(string $entity_type, NodeTypeInterface $type, array &$form, FormStateInterface $form_state) : void {
  $type->setThirdPartySetting('menu_ui', 'available_menus', array_values(array_filter($form_state->getValue('menu_options'))));
  $type->setThirdPartySetting('menu_ui', 'parent', $form_state->getValue('menu_parent'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.