You are here

protected function TermFieldAutocomplete::getTermStorage in GraphQL 8.4

Gets the term storage.

Return value

\Drupal\taxonomy\TermStorageInterface The term storage.

File

src/Plugin/GraphQL/DataProducer/Taxonomy/TermFieldAutocomplete.php, line 133

Class

TermFieldAutocomplete
Gets term items matching the given string in given field's vocabularies.

Namespace

Drupal\graphql\Plugin\GraphQL\DataProducer\Taxonomy

Code

protected function getTermStorage() : TermStorageInterface {
  if (!isset($this->termStorage)) {

    /** @var \Drupal\taxonomy\TermStorageInterface $term_storage */
    $term_storage = $this->entityTypeManager
      ->getStorage('taxonomy_term');
    $this->termStorage = $term_storage;
  }
  return $this->termStorage;
}