예제 #1
0
파일: Answers_model.php 프로젝트: Assem/PMS
 /**
  * Class Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->load->model('questions_model');
     $this->table_name = 'answers';
     $this->pk_column = 'id';
     $this->parent_column = 'id_question';
 }
예제 #2
0
 /**
  * If update goes fine then we have to delete all old answers if needed
  * 
  * {@inheritDoc}
  * @see MY_Model::update()
  */
 public function update($id, $data)
 {
     $question = $this->getRecordByID($id);
     $res = parent::update($id, $data);
     if ($res && $data['type'] != $question->type && $data['type'] == 'free_text') {
         $this->deleteAnswers($id);
     }
     return $res;
 }