Skip to content

Instantly share code, notes, and snippets.

@jhartikainen
Created April 29, 2012 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhartikainen/2552549 to your computer and use it in GitHub Desktop.
Save jhartikainen/2552549 to your computer and use it in GitHub Desktop.
let teamIds = nub $ concatMap ((\g -> [gameTeam1 g, gameTeam2 g]) . entityVal) games
//vs
$teamIds = array();
foreach($games as $e) {
$g = $e->getValue();
$teamIds[] = $g->getTeam1();
$teamIds[] = $g->getTeam2();
}
$teamIds = array_unique($teamIds);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment