Esempio n. 1
0
 /**
  * Compare 2 items of a menu
  * @param Menu|MenuItem $a
  * @param Menu|MenuItem $b
  * @return 0 when $a and $b are the same, 1 when $a is bigger then $b, -1 otherwise
  */
 public static function compareItems($a, $b)
 {
     $al = strtolower($a->getLabel());
     $bl = strtolower($b->getLabel());
     if ($al == $bl) {
         return 0;
     }
     return $al > $bl ? +1 : -1;
 }