You are here

function word_link_exchange_get_taxonomy_terms in Word Link 7

Same name and namespace in other branches
  1. 8 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_get_taxonomy_terms()
  2. 7.2 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_get_taxonomy_terms()

Get taxonomy terms from DB.

Parameters

int $vid: Vocabulary id.

int $from: Start from.

int $limit: Query limit.

Return value

array Array with taxonomy terms.

1 call to word_link_exchange_get_taxonomy_terms()
word_link_exchange_import_from_taxonomy in modules/word_link_exchange/word_link_exchange.module
Import links from taxonomy terms to DB.

File

modules/word_link_exchange/word_link_exchange.module, line 368
Code for the Word link exchange module.

Code

function word_link_exchange_get_taxonomy_terms($vid, $from, $limit) {
  $query = db_select('taxonomy_term_data', 't');
  $query
    ->range($from, $limit);
  $result = $query
    ->fields('t', array(
    'name',
    'tid',
  ))
    ->condition('t.vid', $vid)
    ->orderBy('t.tid')
    ->execute();
  foreach ($result as $term) {
    $terms[$term->tid] = $term;
  }
  return $terms;
}