public function getAvailableForExaminationRepprovedSubject(ExaminationRepprovedSubject $examination_repproved_subject)
 {
     return StudentRepprovedCourseSubjectPeer::doSelect(self::getAvailableForExaminationRepprovedSubjectCriteria($examination_repproved_subject));
 }
 public function repproveStudent(Student $student, $student_career_school_year, PropelPDO $con = null)
 {
     $student_career_school_year->setStatus(StudentCareerSchoolYearStatus::REPPROVED);
     $student_career_school_year->save($con);
     $career_school_year = $student_career_school_year->getCareerSchoolYear();
     // se eliminan las previas que se habian generado en este año de cursada
     $c = new Criteria();
     $c->addJoin(StudentRepprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID);
     $c->add(CourseSubjectStudentPeer::STUDENT_ID, $student->getId());
     $c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID);
     $c->addJoin(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, CareerSubjectSchoolYearPeer::ID);
     $c->add(CareerSubjectSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, $career_school_year->getId());
     foreach (StudentRepprovedCourseSubjectPeer::doSelect($c, $con) as $repproved) {
         $repproved->delete($con);
     }
 }
 /**
  * Returns the available students for the given examination repproved subject.
  *
  * @param ExaminationRepprovedSubject $examination_repproved_subject
  * @return array
  */
 public function getAvailableStudentsForExaminationRepprovedSubject(ExaminationRepprovedSubject $examination_repproved_subject)
 {
     $c = new Criteria();
     $c->add(StudentRepprovedCourseSubjectPeer::STUDENT_APPROVED_CAREER_SUBJECT_ID, null, Criteria::ISNULL);
     $c->addJoin(StudentRepprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID);
     $c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID);
     $c->addJoin(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, CareerSubjectSchoolYearPeer::ID);
     $c->addJoin(CareerSubjectSchoolYearPeer::CAREER_SUBJECT_ID, $examination_repproved_subject->getCareerSubjectId());
     return StudentRepprovedCourseSubjectPeer::doSelect($c);
 }
Exemplo n.º 4
0
 public function getStudentRepprovedCourseSubjectForSchoolYear(SchoolYear $school_year = null)
 {
     if (is_null($school_year)) {
         return array();
     }
     $c = new Criteria();
     $c->add(CourseSubjectStudentPeer::STUDENT_ID, $this->getId());
     $c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID);
     $c->addJoin(CourseSubjectPeer::COURSE_ID, CoursePeer::ID);
     $c->add(CoursePeer::SCHOOL_YEAR_ID, $school_year->getId());
     $c->addJoin(StudentRepprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID);
     return StudentRepprovedCourseSubjectPeer::doSelect($c);
 }