function taxonomy_test_taxonomy_term_insert

Implements hook_taxonomy_term_insert().

File

drupal/core/modules/system/tests/modules/taxonomy_test/taxonomy_test.module, line 27
Test module for Taxonomy hooks and functions not used in core.

Code

function taxonomy_test_taxonomy_term_insert(Term $term) {
  if (!empty($term->antonym)) {
    db_insert('taxonomy_term_antonym')
      ->fields(array(
      'tid' => $term->tid,
      'name' => trim($term->antonym),
    ))
      ->execute();
  }
}