You are here

function beautytips_manager_save_custom_style in BeautyTips 8

Same name and namespace in other branches
  1. 7.2 beautytips_manager.module \beautytips_manager_save_custom_style()

Save a singular beautytip style.

1 call to beautytips_manager_save_custom_style()
CustomStylesEditForm::submitForm in beautytips_manager/src/Form/CustomStylesEditForm.php
Form submission handler.

File

beautytips_manager/beautytips_manager.module, line 243
Code related to defining and displaying custom beautytips and styles.

Code

function beautytips_manager_save_custom_style($style) {
  $style = (array) $style;
  $style_id = isset($style['id']) && $style['id'] ? $style['id'] : NULL;
  \Drupal::database()
    ->merge('beautytips_custom_styles')
    ->key([
    'id' => $style_id,
  ])
    ->fields($style)
    ->execute();
  return $style;
}