コード例 #1
0
 public function newAction(Request $request)
 {
     $this->check();
     $id = $request->get('id');
     $diseases = new DiseaseCollection();
     $users = new UserCollection();
     $patient = new Patient();
     $patient->load($id);
     $data = array();
     $data['diseases'] = $diseases->getAllItemsData();
     $data['users'] = $users->getAllItemsData();
     if ($patient->getId()) {
         $data['patients'] = $patient->getData();
     } else {
         $patient = new PatientCollection();
         $data['patients'] = $patient->getAllItemsData();
     }
     return $this->render('PatientDiseaseBundle:Default:patientdiseaseedit.html.twig', array('data' => $data, 'user' => $this->getUserDataHeader($request->getSession()), 'template_type' => 'New'));
 }
コード例 #2
0
 /**
  * Load diseases data and return as json.
  *
  * @return Response
  */
 public function loadAction()
 {
     $new = new DiseaseCollection();
     $data['items'] = $new->getAllItemsData();
     return new Response(json_encode($data));
 }