1 taxonomy_test.module taxonomy_test_taxonomy_term_insert(TaxonomyTerm $term)

Implements hook_taxonomy_term_insert().

File

core/modules/simpletest/tests/taxonomy_test.module, line 25
Test module for Taxonomy hooks and functions not used in core.

Code

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