function DraggableListBuilderTrait::setWeight

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Entity/DraggableListBuilderTrait.php \Drupal\Core\Entity\DraggableListBuilderTrait::setWeight()

Sets the weight of an entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity whose weight will be set.

int|float $weight: The weight to set on the entity.

Return value

$this

1 call to DraggableListBuilderTrait::setWeight()
DraggableListBuilderTrait::submitForm in core/lib/Drupal/Core/Entity/DraggableListBuilderTrait.php
Form submission handler.
1 method overrides DraggableListBuilderTrait::setWeight()
DraggableListBuilder::setWeight in core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php
Sets the weight of an entity.

File

core/lib/Drupal/Core/Entity/DraggableListBuilderTrait.php, line 64

Class

DraggableListBuilderTrait
Provides a trait for draggable listings of entities.

Namespace

Drupal\Core\Entity

Code

protected abstract function setWeight(EntityInterface $entity, int|float $weight) : EntityInterface;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.