private function importTournament(Tournament $source_tournament, Tournament $tournament) { $em = $this->getDoctrine()->getEntityManager(); $em->beginTransaction(); try { $tournament->setKey(uniqid()); $tournament->setEdition($source_tournament->getEdition()); $tournament->setName($source_tournament->getName() . ' ' . $this->get('translator')->trans('FORM.TOURNAMENTIMPORT.COPY', array(), 'admin')); $tournament->setDescription($source_tournament->getDescription()); $tournament->getOption()->setDrr($source_tournament->getOption()->isDrr()); $tournament->getOption()->setStrategy($source_tournament->getOption()->getStrategy()); $tournament->getOption()->setWpoints($source_tournament->getOption()->getWpoints()); $tournament->getOption()->setTpoints($source_tournament->getOption()->getTpoints()); $tournament->getOption()->setLpoints($source_tournament->getOption()->getLpoints()); $tournament->getOption()->setDscore($source_tournament->getOption()->getDscore()); $em->persist($tournament); $em->flush(); $this->importSites($source_tournament, $tournament); $em->commit(); } catch (Exception $e) { $em->rollBack(); throw $e; } }