You are here

function taxonomy_menu_save_option in Taxonomy menu 6.3

Save the taxonomy options. Check to see if the option exists first

Parameters

$option object: ->name ->type ->value ->type_key

1 call to taxonomy_menu_save_option()
_taxonomy_menu_save_options in ./taxonomy_menu.admin.inc
Function to save an array of options

File

./taxonomy_menu.database.inc, line 126
Taxonomy Menu functions that access the db

Code

function taxonomy_menu_save_option($option) {
  $old_value = taxonomy_menu_get_option($option->name, $option->type, NULL, $option->type_key);
  if (!isset($old_value) || $old_value === FALSE) {

    //option does not exist, insert new record
    drupal_write_record('taxonomy_menu_options', $option);
  }
  else {

    //record exists and update it
    drupal_write_record('taxonomy_menu_options', $option, array(
      'name',
      'type',
      'type_key',
    ));
  }
}