You are here

public function TamperPluginCollection::sortHelper in Feeds Tamper 8.2

Provides uasort() callback to sort plugins.

Overrides DefaultLazyPluginCollection::sortHelper

File

src/TamperPluginCollection.php, line 22

Class

TamperPluginCollection
Collection of Tamper plugins for a specific Feeds importer.

Namespace

Drupal\feeds_tamper

Code

public function sortHelper($aID, $bID) {
  $a = $this
    ->get($aID)
    ->getSetting('weight');
  $b = $this
    ->get($bID)
    ->getSetting('weight');
  if ($a != $b) {
    return $a < $b ? -1 : 1;
  }
  return parent::sortHelper($aID, $bID);
}