public function DashboardStorage::loadMultipleOrderedByWeight in Dashboards with Layout Builder 2.0.x
Same name and namespace in other branches
- 8 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;
}