Exemplo n.º 1
0
 /**
  * @Route("/master_data")
  * @Method({"POST"})
  */
 public function masterDataAction(Request $request)
 {
     $db = $this->get('doctrine')->getConnection();
     // check
     try {
         $db->beginTransaction();
         $db->commit();
         return new Response("Data written");
     } catch (Exception $e) {
         $db->rollback();
         $this->get('logger')->warning(__METHOD__ . ", " . $e->getMessage() . PHP_EOL . $e->getTraceAsString());
         $response = new Response();
         $response->setStatus(450, "Upload problems: " . $e->getMessage());
         return $response;
     }
 }