public function DashboardStorage::loadMultipleOrderedByWeight in Dashboards with Layout Builder 8
Same name and namespace in other branches
- 2.0.x src/Entity/DashboardStorage.php \Drupal\dashboards\Entity\DashboardStorage::loadMultipleOrderedByWeight()
File
- src/
Entity/ DashboardStorage.php, line 19
Class
- DashboardStorage
- Class DashboardStorage.
Namespace
Drupal\dashboards\EntityCode
public function loadMultipleOrderedByWeight(?array $ids = NULL) {
$entites = parent::loadMultiple($ids);
usort($entites, function ($a, $b) {
return $a
->get('weight') <=> $b
->get('weight');
});
return $entites;
}