You are here

WidgetsLazyPluginCollection.php in Entity Browser 8

Same filename and directory in other branches
  1. 8.2 src/WidgetsLazyPluginCollection.php

File

src/WidgetsLazyPluginCollection.php
View source
<?php

namespace Drupal\entity_browser;

use Drupal\Core\Plugin\DefaultLazyPluginCollection;

/**
 * A collection of entity browser widgets.
 */
class WidgetsLazyPluginCollection extends DefaultLazyPluginCollection {

  /**
   * Provides uasort() callback to sort plugins.
   */
  public function sortHelper($a, $b) {
    $weight_a = $this
      ->get($a)
      ->getWeight();
    $weight_b = $this
      ->get($b)
      ->getWeight();
    return $weight_a < $weight_b ? -1 : 1;
  }

}

Classes

Namesort descending Description
WidgetsLazyPluginCollection A collection of entity browser widgets.