예제 #1
0
 public function createRandomGame($users, $sports, $centers)
 {
     $gameDate = $this->getRandomDate();
     $createdDate = clone $gameDate;
     $limitDate = clone $gameDate;
     $game = new Game();
     $game->setAdmin($users[rand(0, 3)]);
     $game->setCreated($createdDate->modify("-10 days"));
     $game->setGameDate($gameDate);
     $game->setLimitDate($limitDate->modify("-1 day"));
     $game->setPrice(rand(3, 10));
     $game->setNumPlayers(rand(3, 10));
     $game->setSport($sports[rand(0, 4)]);
     $game->setDescription("Creo este evento en tal sitio por que quiero bla bla");
     $game->setCenter($centers[rand(0, 4)]);
     $game->addPlayer($users[rand(0, 3)]);
     $game->addPlayer($users[rand(0, 3)]);
     return $game;
 }