You are here

protected function UserExportPluginManager::sortDefinitions in Open Social 8.5

Same name and namespace in other branches
  1. 8.3 modules/social_features/social_user_export/src/Plugin/UserExportPluginManager.php \Drupal\social_user_export\Plugin\UserExportPluginManager::sortDefinitions()
  2. 8.4 modules/social_features/social_user_export/src/Plugin/UserExportPluginManager.php \Drupal\social_user_export\Plugin\UserExportPluginManager::sortDefinitions()
  3. 8.6 modules/social_features/social_user_export/src/Plugin/UserExportPluginManager.php \Drupal\social_user_export\Plugin\UserExportPluginManager::sortDefinitions()
  4. 8.7 modules/social_features/social_user_export/src/Plugin/UserExportPluginManager.php \Drupal\social_user_export\Plugin\UserExportPluginManager::sortDefinitions()

Order by weight.

Parameters

array $a: First parameter.

array $b: Second parameter.

Return value

int The weight to be used for the usort function.

File

modules/social_features/social_user_export/src/Plugin/UserExportPluginManager.php, line 55

Class

UserExportPluginManager
Provides the User export plugin plugin manager.

Namespace

Drupal\social_user_export\Plugin

Code

protected function sortDefinitions(array $a, array $b) {
  if (isset($a['weight']) && isset($b['weight'])) {
    return $a['weight'] < $b['weight'] ? -1 : 1;
  }
  return 0;
}