You are here

function _yandex_metrics_reports_sort_reports_by_weight in Yandex.Metrics 8.3

Same name and namespace in other branches
  1. 7.3 yandex_metrics_reports/yandex_metrics_reports.module \_yandex_metrics_reports_sort_reports_by_weight()

Sort callback that helps to sort reports by weight.

1 string reference to '_yandex_metrics_reports_sort_reports_by_weight'
yandex_metrics_reports_sort_and_save in yandex_metrics_reports/yandex_metrics_reports.module
Sort and save reports array to the variable.

File

yandex_metrics_reports/yandex_metrics_reports.module, line 603
The main code of Yandex.Metrics Reports module.

Code

function _yandex_metrics_reports_sort_reports_by_weight($a, $b) {
  if (!isset($a['weight'])) {
    $a['weight'] = 0;
  }
  if (!isset($b['weight'])) {
    $b['weight'] = 0;
  }
  return $a['weight'] - $b['weight'];
}