Get a taxonomy term by its name.

Parameters

string $term: The taxonomy term to search for.

int $vid: The vocabulary ID to search.

Return value

\Drupal\taxonomy\Entity\Term|null The taxonomy term.

1 call to ExifContent::getTermByName()
ExifContent::handleTaxonomyField in src/ExifContent.php
Handle taxonomy field.

File

src/ExifContent.php, line 643

Class

ExifContent
Class ExifContent make link between drupal content and file content.

Namespace

Drupal\exif

Code

protected function getTermByName($term, $vid) {
    return \Drupal::entityTypeManager()->getStorage('taxonomy_vocabulary')
        ->loadByProperties([
        'name' => $term,
        'vid' => $vid,
    ]);
}