SortArray::sortByWeightProperty

public static SortArray::sortByWeightProperty($a, $b)

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

core/lib/Drupal/Component/Utility/SortArray.php, line 48

Class

SortArray
Provides generic array sorting helper methods.

Namespace

Drupal\Component\Utility

Code

public static function sortByWeightProperty($a, $b) {
  return static::sortByKeyInt($a, $b, '#weight');
}
doc_Drupal
2016-10-29 09:43:12
Comments
Leave a Comment

Please login to continue.