function FilterPluginCollection::sortHelper
Same name in other branches
- 9 core/modules/filter/src/FilterPluginCollection.php \Drupal\filter\FilterPluginCollection::sortHelper()
- 10 core/modules/filter/src/FilterPluginCollection.php \Drupal\filter\FilterPluginCollection::sortHelper()
- 11.x core/modules/filter/src/FilterPluginCollection.php \Drupal\filter\FilterPluginCollection::sortHelper()
Overrides DefaultLazyPluginCollection::sortHelper
File
-
core/
modules/ filter/ src/ FilterPluginCollection.php, line 90
Class
- FilterPluginCollection
- A collection of filters.
Namespace
Drupal\filterCode
public function sortHelper($aID, $bID) {
$a = $this->get($aID);
$b = $this->get($bID);
if ($a->status != $b->status) {
return !empty($a->status) ? -1 : 1;
}
if ($a->weight != $b->weight) {
return $a->weight < $b->weight ? -1 : 1;
}
if ($a->provider != $b->provider) {
return strnatcasecmp($a->provider, $b->provider);
}
return parent::sortHelper($aID, $bID);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.