📜  Drupal 9 通过词汇机器名称 vid 获取分类术语对象 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:05.385000             🧑  作者: Mango

代码示例1
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());
}