TermStorage::resetWeights

public TermStorage::resetWeights($vid)

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 305

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();
}
doc_Drupal
2016-10-29 09:47:23
Comments
Leave a Comment

Please login to continue.