Esempio n. 1
0
 /**
  * @Route("/Team/create")
  */
 public function createActionTeam($teamName, $countryName)
 {
     $country = new Country();
     $country->setCountryName($countryName);
     $team = new Team();
     $team->setCountryId($countryId);
     $team->setTeamName($teamName);
     // relate this product to the category
     $team->setCountry($country);
     $em = $this->getDoctrine()->getManager();
     $em->persist($team);
     $em->flush();
     $teamArray[] = $team->getId();
     $teamArray[] = $team->getCountryId();
     $teamArray[] = $country->getId();
     $teamArray[] = $country->getCountryName();
     return new Response(json_encode($teamArray));
 }