You are here

function _mvf_unit_suggesters_info_sort in Measured Value Field 7

Supportive function for sorting unit suggesters by their weight.

1 string reference to '_mvf_unit_suggesters_info_sort'
mvf_unit_suggesters_info in ./mvf.module
Collect information about available unit suggesters and their settings.

File

./mvf.module, line 1751
Define a field type of measured value.

Code

function _mvf_unit_suggesters_info_sort($a, $b) {
  $a_weight = isset($a['settings']['weight']) ? $a['settings']['weight'] : 0;
  $b_weight = isset($b['settings']['weight']) ? $b['settings']['weight'] : 0;
  if ($a_weight == $b_weight) {
    return 0;
  }
  return $a_weight < $b_weight ? -1 : 1;
}