function DefaultLazyPluginCollection::sortHelper

Same name in other branches
  1. 9 core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php \Drupal\Core\Plugin\DefaultLazyPluginCollection::sortHelper()
  2. 8.9.x core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php \Drupal\Core\Plugin\DefaultLazyPluginCollection::sortHelper()
  3. 11.x core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php \Drupal\Core\Plugin\DefaultLazyPluginCollection::sortHelper()

Provides uasort() callback to sort plugins.

2 methods override DefaultLazyPluginCollection::sortHelper()
FilterPluginCollection::sortHelper in core/modules/filter/src/FilterPluginCollection.php
Provides uasort() callback to sort plugins.
ImageEffectPluginCollection::sortHelper in core/modules/image/src/ImageEffectPluginCollection.php
Provides uasort() callback to sort plugins.

File

core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php, line 97

Class

DefaultLazyPluginCollection
Provides a default plugin collection for a plugin type.

Namespace

Drupal\Core\Plugin

Code

public function sortHelper($aID, $bID) {
    $a = $this->get($aID);
    $b = $this->get($bID);
    return strnatcasecmp($a->getPluginId(), $b->getPluginId());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.