Exemple #1
0
 public function executeSaveContact()
 {
     $param = $this->getAllRequestParameter();
     if (empty($param['id'])) {
         $this->jsonwrapper->show_json_error('#empty-id', 'Missing ID parameter');
     }
     if (empty($param['phone'])) {
         $this->jsonwrapper->show_json_error('#empty-phone', 'Missing phone parameter');
     }
     $student = StudentPeer::RetrieveByPk($param['id']);
     if (!$student) {
         $this->jsonwrapper->show_json_error('#student-not-found', 'Student Not Found');
     }
     $student->getStudentDetail()->setCellphone($param['phone']);
     $student->save();
     $this->jsonwrapper->print_json(array('success' => 1, 'data' => array('id' => $student->getId(), 'phone' => $student->getStudentDetail()->getCellphone())));
 }