function DraggableListBuilder::setWeight
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php \Drupal\Core\Config\Entity\DraggableListBuilder::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
Overrides DraggableListBuilderTrait::setWeight
File
-
core/
lib/ Drupal/ Core/ Config/ Entity/ DraggableListBuilder.php, line 45
Class
- DraggableListBuilder
- Defines a class to build a draggable listing of configuration entities.
Namespace
Drupal\Core\Config\EntityCode
protected function setWeight(EntityInterface $entity, int|float $weight) : EntityInterface {
/** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
$entity->set($this->weightKey, $weight);
return $entity;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.