You are here

function _cheeseburger_menu_save_third_party_settings in Cheeseburger Menu 5.0.x

Save third party setting added to menu on form submission.

1 string reference to '_cheeseburger_menu_save_third_party_settings'
cheeseburger_menu_form_menu_edit_form_alter in ./cheeseburger_menu.module
Implements hook_form_FORM_ID_alter().

File

./cheeseburger_menu.module, line 182
Contains cheeseburger_menu.module.

Code

function _cheeseburger_menu_save_third_party_settings($form, FormStateInterface $form_state) {

  /** @var \Drupal\system\Entity\Menu $menu */
  $menu = $form_state
    ->getFormObject()
    ->getEntity();
  $menu
    ->setThirdPartySetting('cheeseburger_menu', 'use_langcode', (bool) $form_state
    ->getValue('use_langcode'));
  $menu
    ->save();
}