コード例 #1
0
 public static function countStudentInscriptionsForCareerSubjectSchoolYear($course_subject_id, $student_id)
 {
     $course_subject = CourseSubjectPeer::retrieveByPk($course_subject_id);
     $c = new Criteria();
     $c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID);
     $c->add(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, $course_subject->getCareerSubjectSchoolYearId());
     $c->add(CourseSubjectStudentPeer::STUDENT_ID, $student_id);
     $c->addAnd(CourseSubjectPeer::ID, $course_subject_id, Criteria::NOT_EQUAL);
     return CourseSubjectStudentPeer::doCount($c);
 }
コード例 #2
0
ファイル: Course.php プロジェクト: nvidela/kimkelen
 public function canRevertCalificate(PropelPDO $con = null)
 {
     $course_subject = CourseSubjectPeer::retrieveByCourseId($this->getId());
     if (!is_null($course_subject)) {
         $c = new Criteria();
         $c->add(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, $course_subject->getId());
         $c->add(CourseSubjectStudentPeer::IS_NOT_AVERAGEABLE, true);
         return CourseSubjectStudentPeer::doCount($c) > 0;
     }
     return true;
 }