/** * Returns the next examination number for the given school year. * * @param SchoolYear $school_year A school year. * @return integer The next examation number. */ public static function getNextExaminationNumberFor(SchoolYear $school_year) { $c = new Criteria(); $c->add(self::SCHOOL_YEAR_ID, $school_year->getId()); $c->addDescendingOrderByColumn(self::EXAMINATION_NUMBER); $obj = self::doSelectOne($c); return $obj->getExaminationNumber() + 1; }
public static function countExaminationRepprovedWithoutSubjects(SchoolYear $school_year, $type, PropelPDO $con = null) { $con = is_null($con) ? Propel::getConnection() : $con; $c = new Criteria(); $c->add(ExaminationRepprovedPeer::SCHOOL_YEAR_ID, $school_year->getId()); $c->addJoin(ExaminationRepprovedSubjectPeer::EXAMINATION_REPPROVED_ID, ExaminationRepprovedPeer::ID, Criteria::RIGHT_JOIN); $c->add(ExaminationRepprovedSubjectPeer::ID, null, Criteria::ISNULL); return ExaminationRepprovedPeer::doCount($c, $con); }
public static function countNotClosedExaminationSubjectsFor(SchoolYear $school_year, PropelPDO $con = null) { $con = is_null($con) ? Propel::getConnection() : $con; $c = new Criteria(); $c->add(ExaminationPeer::SCHOOL_YEAR_ID, $school_year->getId()); $c->addJoin(ExaminationSubjectPeer::EXAMINATION_ID, ExaminationPeer::ID); $c->add(ExaminationSubjectPeer::IS_CLOSED, false); return ExaminationSubjectPeer::doCount($c, $con); }
public static function retrieveComissionsForSchoolYearCriteria(SchoolYear $school_year) { $c = new Criteria(); $c->add(CareerSchoolYearPeer::SCHOOL_YEAR_ID, $school_year->getId()); $c->addJoin(CareerSchoolYearPeer::ID, CareerSubjectSchoolYearPeer::CAREER_SCHOOL_YEAR_ID); $c->addJoin(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, CareerSubjectSchoolYearPeer::ID); $c->addJoin(CourseSubjectPeer::COURSE_ID, CoursePeer::ID); $c->add(CoursePeer::DIVISION_ID, null, Criteria::ISNULL); return $c; }
/** * This method returns all the divisions of the SchoolYear passed fot the student given * * @param Student $student * @param SchoolYear $school_year * @return <array> Division */ public static function retrieveStudentSchoolYearDivisions($school_year, $student) { $criteria = new Criteria(); $criteria->add(CareerSchoolYearPeer::SCHOOL_YEAR_ID, $school_year->getId()); $criteria->addJoin(self::CAREER_SCHOOL_YEAR_ID, CareerSchoolYearPeer::ID); $criteria->addJoin(self::ID, DivisionStudentPeer::DIVISION_ID); $criteria->add(DivisionStudentPeer::STUDENT_ID, $student->getId()); $criteria->addAscendingOrderByColumn(self::YEAR); return self::doSelect($criteria); }
/** * Returns the next examination number for the given school year. * * @param SchoolYear $school_year A school year. * @return integer The next examation number. */ public static function getNextExaminationNumberFor(SchoolYear $school_year) { $c = new Criteria(); $c->add(self::SCHOOL_YEAR_ID, $school_year->getId()); return self::doCount($c) + 1; }
/** * Returns the number of disapproved for the given school year. * * @param SchoolYear $school_year * @return integer the disapproved count */ public function countDisapprovedForSchoolYear(SchoolYear $school_year, PropelPDO $con = null) { $con = is_null($con) ? Propel::getConnection() : $con; $c = new Criteria(); $c->addJoin(StudentDisapprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID); $c->add(CourseSubjectStudentPeer::STUDENT_ID, $this->getId()); $previous_ids = array_map(create_function('$c', 'return $c->getId();'), CourseSubjectStudentPeer::doSelect($c)); $c = new Criteria(); $c->add(CourseSubjectStudentPeer::STUDENT_ID, $this->getId()); $c->add(CoursePeer::SCHOOL_YEAR_ID, $school_year->getId()); $c->addJoin(CoursePeer::ID, CourseSubjectPeer::COURSE_ID); $c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID); $c->addJoin(CourseSubjectStudentPeer::ID, StudentDisapprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID); $c->add(StudentDisapprovedCourseSubjectPeer::STUDENT_APPROVED_CAREER_SUBJECT_ID, null, Criteria::ISNULL); $c->add(StudentDisapprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, $previous_ids, Criteria::NOT_IN); return StudentDisapprovedCourseSubjectPeer::doCount($c, $con); }