You are here

function _path_breadcrumbs_sort_weight in Path Breadcrumbs 7.2

Same name and namespace in other branches
  1. 7.3 path_breadcrumbs.module \_path_breadcrumbs_sort_weight()

This is version of drupal_sort_weight() for objects. Function used by uasort to sort array of objects by weight.

Parameters

$a:

$b:

Return value

int

1 string reference to '_path_breadcrumbs_sort_weight'
path_breadcrumbs_load_all in ./path_breadcrumbs.module
Load all path breadcrumbs from database and code.

File

./path_breadcrumbs.module, line 621
Provide core functions for path breadcrumbs modue.

Code

function _path_breadcrumbs_sort_weight($a, $b) {
  $a_weight = isset($a->weight) ? $a->weight : 0;
  $b_weight = isset($b->weight) ? $b->weight : 0;
  if ($a_weight == $b_weight) {
    return 0;
  }
  return $a_weight < $b_weight ? -1 : 1;
}