3 namespace Drupal\entity_browser;
5 use Drupal\Core\Plugin\DefaultLazyPluginCollection;
8 * A collection of entity browser widgets.
10 class WidgetsLazyPluginCollection extends DefaultLazyPluginCollection {
13 * Provides uasort() callback to sort plugins.
15 public function sortHelper($a, $b) {
16 $weight_a = $this->get($a)->getWeight();
17 $weight_b = $this->get($b)->getWeight();
19 return $weight_a < $weight_b ? -1 : 1;