You are here

function Notifications_Taxonomy_Term_Field::autocomplete_parse in Notifications 7

Parse value from autocomplete, get the first matching term

Overrides Notifications_Field_Autocomplete::autocomplete_parse

File

notifications_tags/notifications_tags.inc, line 79
Drupal Notifications Framework - Default class file

Class

Notifications_Taxonomy_Term_Field
Taxonomy term field

Code

function autocomplete_parse($string) {
  if ($terms = taxonomy_get_term_by_name($string)) {
    $term = reset($terms);
    return $term->tid;
  }
}