Question : Drupal 9 Get taxonomy term objects by vocabulary machine name vid
Answered by : cheryl-mcnamee
try { $terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties(['vid' => 'my_vocablary_machine_name']);
} catch (Exception $e) { throw new HttpException(400,'Error upon selection of terms/session_tracks. ' . $e->getMessage());
}
Source : | Last Update : Tue, 11 Jan 22