public static function SortArray::sortByWeightProperty in Service Container 7.2
Same name and namespace in other branches
- 7 lib/Drupal/Component/Utility/SortArray.php \Drupal\Component\Utility\SortArray::sortByWeightProperty()
Sorts a structured array by '#weight' property.
Callback for uasort().
Parameters
array $a: First item for comparison. The compared items should be associative arrays that optionally include a '#weight' key.
array $b: Second item for comparison.
Return value
int The comparison result for uasort().
File
- lib/
Drupal/ Component/ Utility/ SortArray.php, line 53 - Contains \Drupal\Component\Utility\SortArray.
Class
- SortArray
- Provides generic array sorting helper methods.
Namespace
Drupal\Component\UtilityCode
public static function sortByWeightProperty($a, $b) {
return static::sortByKeyInt($a, $b, '#weight');
}