You are here

function hashtags_get_terms_by_names in Hashtags 7

Same name and namespace in other branches
  1. 6 hashtags.module \hashtags_get_terms_by_names()
1 call to hashtags_get_terms_by_names()
_hashtags_filter_process in ./hashtags.module

File

./hashtags.module, line 763

Code

function hashtags_get_terms_by_names($names) {
  $terms = array();
  $vid = variable_get('hashtags_vocabulary', '');
  $sql = "SELECT ttd.name, ttd.tid FROM {taxonomy_term_data} ttd   \n  WHERE lower(ttd.name) IN (:names) AND ttd.vid = :vid";
  $result = db_query($sql, array(
    ':names' => $names,
    ':vid' => $vid,
  ));
  foreach ($result as $term) {
    $terms[$term->name] = $term->tid;
  }
  return $terms;
}