function ShortcutSet::resetLinkWeights
Same name in other branches
- 8.9.x core/modules/shortcut/src/Entity/ShortcutSet.php \Drupal\shortcut\Entity\ShortcutSet::resetLinkWeights()
- 10 core/modules/shortcut/src/Entity/ShortcutSet.php \Drupal\shortcut\Entity\ShortcutSet::resetLinkWeights()
- 11.x core/modules/shortcut/src/Entity/ShortcutSet.php \Drupal\shortcut\Entity\ShortcutSet::resetLinkWeights()
Overrides ShortcutSetInterface::resetLinkWeights
File
-
core/
modules/ shortcut/ src/ Entity/ ShortcutSet.php, line 113
Class
- ShortcutSet
- Defines the Shortcut set configuration entity.
Namespace
Drupal\shortcut\EntityCode
public function resetLinkWeights() {
$weight = -50;
foreach ($this->getShortcuts() as $shortcut) {
$shortcut->setWeight(++$weight);
$shortcut->save();
}
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.