You are here

public function NewTermStorage::get in Super Term Reference Autocomplete Widget 8

Gets a term from the storage, or NULL if it doesn't exist.

Parameters

string $bundle: The vocabulary in which to check for the term.

string $tree_path: A string containing the hierarchy of what term to look up.

Return value

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

File

src/NewTermStorage.php, line 34

Class

NewTermStorage
Stores terms which have been created by Straw but not yet saved by Drupal.

Namespace

Drupal\straw

Code

public function get($bundle, $tree_path) {
  return $this->termStorage[$bundle][$tree_path] ?? NULL;
}