Example #1
0
 /**
  * @Route("/person/create")
  */
 public function createActionPerson()
 {
     $person = new Person();
     $person->setLevelId(1);
     $person->setFirstName('A Foo Bar');
     $person->setLastName('A Foo Bar');
     $person->setRegisterDate('20.01.2015 15:35:35');
     $person->setEmail('A Foo Bar');
     $person->setPhonenumber('A Foo Bar');
     $person->setPassword('A Foo Bar');
     $em = $this->getDoctrine()->getManager();
     $em->persist($person);
     $em->flush();
     $personArray[] = $person->getId();
     $personArray[] = $person->getLevelId();
     $personArray[] = $person->getFirstName();
     $personArray[] = $person->getLastName();
     $personArray[] = $person->getRegisterDate();
     $personArray[] = $person->getEmail();
     $personArray[] = $person->getPhonenumber();
     $personArray[] = $person->getPassword();
     return new Response(json_encode($personArray));
 }