Exemplo n.º 1
0
 /**
  * Compare two menu items by their priority
  *
  * @param ElggMenuItem $a Menu item
  * @param ElggMenuItem $b Menu item
  * @return bool
  *
  * @todo change name to compareByPriority
  */
 public static function compareByWeight($a, $b)
 {
     $aw = $a->getWeight();
     $bw = $b->getWeight();
     if ($aw == $bw) {
         return $a->getData('original_order') - $b->getData('original_order');
     }
     return $aw - $bw;
 }