function taxonomy_term_save

Saves a term object to the database.

Parameters

Drupal\taxonomy\Term $term: The taxonomy term entity to be saved.

Return value

Status constant indicating whether term was inserted (SAVED_NEW) or updated (SAVED_UPDATED). When inserting a new term, $term->tid will contain the term ID of the newly created term.

15 calls to taxonomy_term_save()
DefaultViewsTest::createTerm in drupal/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
Returns a new term with random properties in vocabulary $vid.
EntityCrudHookTest::testTaxonomyTermHooks in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCrudHookTest.php
Tests hook invocations for CRUD operations on taxonomy terms.
EntityFilteringThemeTest::setUp in drupal/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
Sets up a Drupal site for running functional and integration tests.
forum_enable in drupal/core/modules/forum/forum.install
Implements hook_enable().
forum_form_submit in drupal/core/modules/forum/forum.admin.inc
Form submission handler for forum_form_forum() and forum_form_container().

... See full list

File

drupal/core/modules/taxonomy/taxonomy.module, line 505
Enables the organization of content into categories.

Code

function taxonomy_term_save(Term $term) {
  return $term
    ->save();
}