Skip to content

Instantly share code, notes, and snippets.

@jonsherrard
Created October 8, 2012 14:46
Show Gist options
  • Save jonsherrard/3852910 to your computer and use it in GitHub Desktop.
Save jonsherrard/3852910 to your computer and use it in GitHub Desktop.
active_game.php
$this->facebook_id = $facebook_id;
$active_game = array_filter($games, function($game) {
return $game->active;
});
if (count($active_game) > 1):
$active_game = array_filter($active_game, function($game) {return $game->creator === $this->facebook_id;});
endif;
if (count($active_game)) $active_game[0]->garments = $this->get_garments($active_game[0]->game_id);
return $active_game[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment