예제 #1
0
 public static function retrieveByStudentCareerSchoolYear(StudentCareerSchoolYear $student_career_school_year)
 {
     $c = new Criteria();
     $c->add(self::CAREER_SCHOOL_YEAR_ID, $student_career_school_year->getCareerSchoolYearId());
     $c->addJoin(DivisionStudentPeer::DIVISION_ID, self::ID);
     $c->add(DivisionStudentPeer::STUDENT_ID, $student_career_school_year->getStudentId());
     return self::doSelectOne($c);
 }
예제 #2
0
 /**
  * This method retrieves one Student free if exists, filtering by parameters
  *
  * @param Student $student
  * @param CareerSchoolYearPeriod $career_school_year_period
  * @param type $course_subject
  *
  * return StudentFree
  */
 public static function retrieveByStudentCareerSchoolYearCareerSchoolYearPeriodAndCourse(StudentCareerSchoolYear $student_career_school_year, CareerSchoolYearPeriod $career_school_year_period = null, $course_subject = null)
 {
     $c = new Criteria();
     $c->add(self::STUDENT_ID, $student_career_school_year->getStudentId());
     $c->add(self::IS_FREE, true);
     $c->add(self::CAREER_SCHOOL_YEAR_ID, $student_career_school_year->getCareerSchoolYearId());
     if (!is_null($career_school_year_period) && !is_null($career_school_year_period->getMaxAbsences())) {
         $c->add(self::CAREER_SCHOOL_YEAR_PERIOD_ID, $career_school_year_period->getId());
     }
     if (!is_null($course_subject)) {
         $c->add(self::COURSE_SUBJECT_ID, $course_subject->getId());
     }
     return self::doSelectOne($c);
 }