public function saveExaminationSubjectStudentList($con = null)
 {
     if (!$this->isValid()) {
         throw $this->getErrorSchema();
     }
     if (!isset($this->widgetSchema['examination_subject_student_list'])) {
         // somebody has unset this widget
         return;
     }
     if (is_null($con)) {
         $con = Propel::getConnection();
     }
     $con->beginTransaction();
     try {
         $values = $this->getValue('examination_subject_student_list');
         foreach ($this->getObject()->getCourseSubjectStudentExaminations() as $csse) {
             if (!is_array($values)) {
                 $values = array();
             }
             if (!in_array($csse->getStudent()->getId(), $values)) {
                 $csse->delete($con);
             } else {
                 unset($values[array_search($csse->getStudent()->getId(), $values)]);
             }
         }
         if (is_array($values)) {
             foreach ($values as $student_id) {
                 $course_subject_student_examination = new CourseSubjectStudentExamination();
                 $course_subject_student_examination->setExaminationSubject($this->getObject());
                 $course_subject_student_examination->setExaminationNumber($this->getObject()->getExamination()->getExaminationNumber());
                 $course_subject_student = CourseSubjectStudentPeer::retrieveByCareerSubjectSchoolYearAndStudent($this->getObject()->getCareerSubjectSchoolYear(), $student_id);
                 $course_subject_student_examination->setCourseSubjectStudent($course_subject_student);
                 $course_subject_student_examination->save($con);
             }
         }
         $con->commit();
     } catch (Exception $e) {
         $con->rollBack();
         throw $e;
     }
 }
 public function createCourseSubjectStudentExamination(CourseSubjectStudent $course_subject_student, $con)
 {
     $course_subject_student_examination = new CourseSubjectStudentExamination();
     $course_subject_student_examination->setCourseSubjectStudent($course_subject_student);
     //El if creo que no deberia existir para mantener la integridad de los datos. no deberia  existir course_subject_student_examination sin un examinationNumbre
     //    if (!is_null($course_subject_student->getCourseResult()))
     //    {
     $examination_number = $course_subject_student->getCourseResult()->getExaminationNumber();
     $course_subject_student_examination->setExaminationNumber($examination_number);
     //    }
     $course_subject_student_examination->save($con);
     //Libero memoria
     $course_subject_student_examination->clearAllReferences(true);
     unset($course_subject_student_examination);
     unset($examination_number);
 }