예제 #1
0
 /**
  * Create Constru Type entities.
  *
  * @Route("/add", name="ajax_typeconstru_create")
  * @Method("POST")
  */
 public function ajaxCreateTypeConstru(Request $request)
 {
     $em = $this->getDoctrine()->getManager();
     $object = new TypeConstru();
     $object->setDescription($request->get('description'));
     $em->persist($object);
     $em->flush();
     return new JsonResponse($object->getId());
 }
예제 #2
0
 /**
  * Creates a form to delete a TypeConstru entity.
  *
  * @param TypeConstru $typeConstru The TypeConstru entity
  *
  * @return \Symfony\Component\Form\Form The form
  */
 private function createDeleteForm(TypeConstru $typeConstru)
 {
     return $this->createFormBuilder()->setAction($this->generateUrl('typeconstru_delete', array('id' => $typeConstru->getId())))->setMethod('DELETE')->getForm();
 }