You are here

public function TermStorage::resetWeights in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::resetWeights()

Reset the weights for a given vocabulary ID.

Parameters

string $vid: Vocabulary ID to retrieve terms for.

Overrides TermStorageInterface::resetWeights

File

core/modules/taxonomy/src/TermStorage.php, line 310
Contains \Drupal\taxonomy\TermStorage.

Class

TermStorage
Defines a Controller class for taxonomy terms.

Namespace

Drupal\taxonomy

Code

public function resetWeights($vid) {
  $this->database
    ->update('taxonomy_term_field_data')
    ->fields(array(
    'weight' => 0,
  ))
    ->condition('vid', $vid)
    ->execute();
}