function _taxonomy_menu_get_orphaned_menu_items in Taxonomy menu 7.2
Same name and namespace in other branches
- 8 taxonomy_menu.database.inc \_taxonomy_menu_get_orphaned_menu_items()
Get orphaned menu relations for a vocab.
Parameters
int $vid: The vocabulary's ID.
Return value
array An array of orphaned menu links' ID.
1 call to _taxonomy_menu_get_orphaned_menu_items()
- taxonomy_menu_menu_links_delete in ./
taxonomy_menu.module - Deletes all the menu links associated to a vocabulary.
File
- ./
taxonomy_menu.database.inc, line 88 - Database functions.
Code
function _taxonomy_menu_get_orphaned_menu_items($vid) {
$voc = taxonomy_vocabulary_load($vid);
$menu_name = variable_get('taxonomy_menu_vocab_menu_' . $voc->machine_name, FALSE);
if (!empty($menu_name)) {
$query = db_select('menu_links', 'ml')
->fields('ml', array(
'mlid',
))
->condition('ml.menu_name', $menu_name)
->condition('ml.router_path', 'taxonomy/term/%');
$result = $query
->execute();
return $result
->fetchCol();
}
return FALSE;
}