public static function getAvailableStudentsForExaminationRepprovedSubject(ExaminationRepprovedSubject $examination_repproved_subject) { if ($examination_repproved_subject->getExaminationRepproved()->getExaminationType() == ExaminationRepprovedType::FREE_GRADUATED) { $c = self::getFreeGraduatedStudentsCriteria($examination_repproved_subject); } else { $c = self::getAvailableForExaminationRepprovedSubjectCriteria($examination_repproved_subject); } $c->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentPeer::ID, Criteria::INNER_JOIN); return StudentPeer::doSelect($c); }
/** * Adds the reference for the ExaminationRepprovedSubject to StudentExaminationRepprovedSubjects. * If student is withdrawn then it does not add the reference. * * @param ExaminationRepprovedSubject $examination_repproved_subject * @param PropelPDO $con */ public function updateStudentExaminationRepprovedSubjects($examination_repproved_subject, PropelPDO $con) { if ($examination_repproved_subject->isNew()) { $student_repproved_course_subjects = SchoolBehaviourFactory::getInstance()->getAvailableStudentsForExaminationRepprovedSubject($examination_repproved_subject); foreach ($student_repproved_course_subjects as $student_repproved_course_subject) { $student = $student_repproved_course_subject->getCourseSubjectStudent()->getStudent(); $scsys = StudentCareerSchoolYearPeer::retrieveCareerSchoolYearForStudentAndYear($student, SchoolYearPeer::retrieveCurrent()); if (!empty($scsys) && $scsys[0]->getStatus() != StudentCareerSchoolYearStatus::WITHDRAWN) { $student_examination_repproved_subject = new StudentExaminationRepprovedSubject(); $student_examination_repproved_subject->setStudentRepprovedCourseSubjectId($student_repproved_course_subject->getId()); $examination_repproved_subject->addStudentExaminationRepprovedSubject($student_examination_repproved_subject); } } } }
public function getForms(ExaminationRepprovedSubject $examination_repproved_subject) { $forms = array(); //agrego el orden alfabetico para el listado de alumnos. $criteria = new Criteria(ExaminationRepprovedSubjectPeer::DATABASE_NAME); $criteria->addJoin(StudentExaminationRepprovedSubjectPeer::STUDENT_REPPROVED_COURSE_SUBJECT_ID, StudentRepprovedCourseSubjectPeer::ID); $criteria->addJoin(StudentRepprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID); $criteria->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentPeer::ID); $criteria->addJoin(StudentPeer::PERSON_ID, PersonPeer::ID); $criteria->addAscendingOrderByColumn(PersonPeer::LASTNAME); foreach ($examination_repproved_subject->getStudentExaminationRepprovedSubjects($criteria) as $student_examination_repproved_subject) { $form_name = SchoolBehaviourFactory::getInstance()->getFormFactory()->getStudentExaminationRepprovedSubjectForm(); $form = new $form_name($student_examination_repproved_subject); $form->getWidgetSchema()->setNameFormat("student_examination_repproved_subject_{$student_examination_repproved_subject->getId()}[%s]"); $forms[$student_examination_repproved_subject->getId()] = $form; } return $forms; }
public static function setAvailableStudents(ExaminationRepprovedSubject $examination_repproved_subject) { self::$_students_repproved_course_subject = array_merge($examination_repproved_subject->getStudents(), SchoolBehaviourFactory::getInstance()->getAvailableStudentsForExaminationRepprovedSubject($examination_repproved_subject)); }
/** * 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); }