Advertisement
Guest User

Untitled

a guest
Jan 17th, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. $tmp = array();
  2.       foreach($collection as $item)
  3.       {
  4.         $key = array_search($item->$method(), $orderedIds) ? : 99999999999999999; // 9999 tmp fix until all projects have a name in mongo
  5.  
  6.         $tmp[$key][] = $item;
  7.       }
  8.      
  9.       // order by key index
  10.       ksort($tmp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement