function DraggableListBuilder::getWeight

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

Overrides DraggableListBuilderTrait::getWeight

File

core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php, line 37

Class

DraggableListBuilder
Defines a class to build a draggable listing of configuration entities.

Namespace

Drupal\Core\Config\Entity

Code

protected function getWeight(EntityInterface $entity) : int|float {
    
    /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
    return $entity->get($this->weightKey) ?: 0;
}

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