public function newgameAction() { $em = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager'); $game = new Game(); $game->setActive(true); $game->setDateadd(); $result = new JsonModel(array('result' => true)); return $result; }
public function createGame($em) { $game = new Game(); $date = new \Datetime(); $game->setDateadd($date); $game->setDateupd($date); $game->setActive(1); $em->persist($game); $em->flush(); }