You are here

function _taxonomy_menu_get_mlid in Taxonomy menu 7.2

Same name and namespace in other branches
  1. 8 taxonomy_menu.database.inc \_taxonomy_menu_get_mlid()
  2. 6.2 taxonomy_menu.database.inc \_taxonomy_menu_get_mlid()
  3. 7 taxonomy_menu.database.inc \_taxonomy_menu_get_mlid()

Returns an mlid based on a taxonomy term ID and vocabulary ID.

Parameters

$tid: the term's ID.

$vid: the vocabulary's ID.

$langcode: (optional) Defaults to LANGUAGE_NONE. The language code associated to the menu link's ID.

Return value

the menu link ID associated to the $tid and $vid. If not found, returns FALSE.

11 calls to _taxonomy_menu_get_mlid()
TaxonomyMenuConfigurationTest::testTaxonomyMenuCountNodes in tests/taxonomy_menu.test
Tests Taxonommy Menu "Node count" option.
TaxonomyMenuConfigurationTest::testTaxonomyMenuHideEmptyTerms in tests/taxonomy_menu.test
Tests Taxonommy Menu "Hide Empty terms" option.
TaxonomyMenuConfigurationTest::testTaxonomyMenuSyncOption in tests/taxonomy_menu.test
Tests Taxonommy Menu sync option.
TaxonomyMenuConfigurationTest::testTaxonomyMenuTermDescriptionOption in tests/taxonomy_menu.test
Tests Taxonommy Menu "Term description" option.
TaxonomyMenuCustomPathConfigurationTest::testTaxonomyMenuCustomPathBasePathOption in taxonomy_menu_custom_paths/tests/taxonomy_menu_custom_paths.test
Tests if the path is correct without the depth option.

... See full list

File

./taxonomy_menu.database.inc, line 50
Database functions.

Code

function _taxonomy_menu_get_mlid($tid, $vid, $langcode = LANGUAGE_NONE) {
  $query = db_select('taxonomy_menu', 'tm')
    ->fields('tm', array(
    'mlid',
  ))
    ->condition('tid', $tid)
    ->condition('vid', $vid)
    ->condition('language', $langcode);
  $result = $query
    ->execute()
    ->fetchField();
  return $result;
}