public function WidgetsCollection::sortHelper in Entity Browser 8.2
Same name and namespace in other branches
- 8 src/WidgetsCollection.php \Drupal\entity_browser\WidgetsCollection::sortHelper()
Provides uasort() callback to sort plugins.
Overrides DefaultLazyPluginCollection::sortHelper
File
- src/
WidgetsCollection.php, line 15
Class
- WidgetsCollection
- A collection of entity browser widgets.
Namespace
Drupal\entity_browserCode
public function sortHelper($a, $b) {
$weight_a = $this
->get($a)
->getWeight();
$weight_b = $this
->get($b)
->getWeight();
return $weight_a < $weight_b ? -1 : 1;
}