You are here

public function Shortcut::setWeight in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/shortcut/src/Entity/Shortcut.php \Drupal\shortcut\Entity\Shortcut::setWeight()
  2. 10 core/modules/shortcut/src/Entity/Shortcut.php \Drupal\shortcut\Entity\Shortcut::setWeight()

Sets the weight among shortcuts with the same depth.

Parameters

int $weight: The shortcut weight.

Return value

$this The called shortcut entity.

Overrides ShortcutInterface::setWeight

File

core/modules/shortcut/src/Entity/Shortcut.php, line 84

Class

Shortcut
Defines the shortcut entity class.

Namespace

Drupal\shortcut\Entity

Code

public function setWeight($weight) {
  $this
    ->set('weight', $weight);
  return $this;
}