function _data_taxonomy_save_relations in Data 6
Save term_data - data table relationships in data_taxonomy table.
3 calls to _data_taxonomy_save_relations()
- data_taxonomy_ajax_save in data_taxonomy/
data_taxonomy.module - AHAH callback for saving terms.
- data_taxonomy_tagging_form_submit in data_taxonomy/
data_taxonomy.module - Submit handler.
- _data_taxonomy_save_terms in data_taxonomy/
data_taxonomy.module - Helper function, saves a series of taxonomy terms for a record.
File
- data_taxonomy/
data_taxonomy.module, line 280 - Hooks and API functions for Data Node module.
Code
function _data_taxonomy_save_relations($vid, $id, $table_name, $tids) {
db_query("DELETE dt FROM {data_taxonomy} dt JOIN {term_data} td ON dt.tid = td.tid WHERE dt.id = %d AND dt.data_table_name = '%s' AND td.vid = %d", $id, $table_name, $vid);
foreach ($tids as $tid) {
db_query('INSERT INTO {data_taxonomy} (id, data_table_name, tid) VALUES (%d, "%s", %d)', $id, $table_name, $tid);
}
}