src/Service/NT8PropertyService.php
public static function getTidFromTermName($term_name, $vocab_name) {
    $tid = -1;
    if ($terms = taxonomy_term_load_multiple_by_name($term_name, $vocab_name)) {
      $term = reset($terms);
      $tid = $term->id();
    }

    return $tid;
  }
public static function getTidFromTermName($term_name, $vocab_name) {
    $tid = -1;
    if ($terms = taxonomy_term_load_multiple_by_name($term_name, $vocab_name)) {
      $term = reset($terms);
      $tid = $term->id();
    }

    return $tid;
  }
public static function getTidFromTermName ( $ term_name , $ vocab_name ) { $ tid = - 1 ; if ( $ terms = taxonomy_term_load_multiple_by_name ( $ term_name , $ vocab_name ) ) { $ term = reset ( $ terms ) ; $ tid = $ term -> id ( ) ; } return $ tid ; }
Retrieves a TID for a given term name. Rturns -1 if term couldn't be found.
Retrieves a TID for a given term name . Rturns - 1 if term couldn t be found .