From 025aa2a110f976cd926f303f7296a62a000b037b Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Mon, 17 Jun 2013 23:25:42 +0200 Subject: [PATCH] Issue #1831540 followup by orb: Rewrite examples in taxonomy.api.php and remove references to synonyms. --- core/modules/taxonomy/taxonomy.api.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/core/modules/taxonomy/taxonomy.api.php b/core/modules/taxonomy/taxonomy.api.php index 0371ce62a6b..ca3af0726ef 100644 --- a/core/modules/taxonomy/taxonomy.api.php +++ b/core/modules/taxonomy/taxonomy.api.php @@ -83,11 +83,9 @@ function hook_taxonomy_vocabulary_insert(Drupal\taxonomy\Plugin\Core\Entity\Voca * A taxonomy vocabulary entity. */ function hook_taxonomy_vocabulary_update(Drupal\taxonomy\Plugin\Core\Entity\Vocabulary $vocabulary) { - db_insert('mytable') - ->fields(array( - 'vid' => $vocabulary->id(), - 'foo' => $vocabulary->foo, - )) + db_update('mytable') + ->fields(array('foo' => $vocabulary->foo)) + ->condition('vid', $vocabulary->id()) ->execute(); } @@ -206,11 +204,9 @@ function hook_taxonomy_term_insert(Drupal\taxonomy\Term $term) { * A taxonomy term entity. */ function hook_taxonomy_term_update(Drupal\taxonomy\Term $term) { - db_insert('mytable') - ->fields(array( - 'tid' => $term->id(), - 'foo' => $term->foo, - )) + db_update('mytable') + ->fields(array('foo' => $term->foo)) + ->condition('tid', $term->id()) ->execute(); }