Пример #1
0
 /**
  * @Route("/addAddress/{city}/{street}/{dom}/{flat}")
  */
 public function addAction($city, $street, $dom, $flat)
 {
     $result = $this->check($city, $street, $dom, $flat);
     if ($result == "0") {
         $address = new Address();
         $address->setDom($dom);
         $address->setFlat($flat);
         $address->setStreet($street);
         $address->setCity($city);
         $em = $this->getDoctrine()->getManager();
         $em->persist($address);
         $em->flush();
     }
     $result = array("response" => $this->check($city, $street, $dom, $flat));
     $response = new Response(json_encode($result));
     $response->headers->set('Content-Type', 'application/json');
     return $response;
 }
 /**
  * {@inheritDoc}
  */
 public function setDom($dom)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDom', array($dom));
     return parent::setDom($dom);
 }