function TermStorage::resetWeights
Same name in other branches
- 9 core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::resetWeights()
- 10 core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::resetWeights()
- 11.x core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::resetWeights()
Overrides TermStorageInterface::resetWeights
File
-
core/
modules/ taxonomy/ src/ TermStorage.php, line 332
Class
- TermStorage
- Defines a Controller class for taxonomy terms.
Namespace
Drupal\taxonomyCode
public function resetWeights($vid) {
$this->database
->update($this->getDataTable())
->fields([
'weight' => 0,
])
->condition('vid', $vid)
->execute();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.