public static function WeMegaMenuBuilder::saveConfig in Drupal Mega Menu 8
Same name and namespace in other branches
- 8.x src/WeMegaMenuBuilder.php \Drupal\we_megamenu\WeMegaMenuBuilder::saveConfig()
Save config Drupal 8 Mega Menu.
Parameters
string $menu_name: Public static function saveConfig menu_name.
string $theme: Public static function saveConfig theme.
object $data_config: Public static function saveConfig data_config.
Return value
object Public static function saveConfig string.
7 calls to WeMegaMenuBuilder::saveConfig()
- template_preprocess_we_megamenu_backend in ./
we_megamenu.module - template_preprocess_we_megamenu_frontend in ./
we_megamenu.module - Prepare variables for we_megamenu_frontend.
- WeMegaMenuAdminController::saveConfigWeMegaMenu in src/
Controller/ WeMegaMenuAdminController.php - A function ajax save menu config.
- WeMegaMenuBuilder::initMegamenu in src/
WeMegaMenuBuilder.php - we_megamenu_entity_delete in ./
we_megamenu.module - Implements hook_entity_delete().
File
- src/
WeMegaMenuBuilder.php, line 326
Class
Namespace
Drupal\we_megamenuCode
public static function saveConfig($menu_name, $theme, $data_config) {
$result = Drupal::service('database')
->merge('we_megamenu')
->key([
'menu_name' => $menu_name,
'theme' => $theme,
])
->fields([
'data_config' => $data_config,
])
->execute();
return $data_config;
}