示例#1
0
 public function canCreateExaminationRepprovedSubject()
 {
     $school_year = SchoolYearPeer::retrieveByPK($this->getReferenceFor("schoolyear"));
     return $school_year->getIsActive() && StudentRepprovedCourseSubjectPeer::doCount(new Criteria()) > 0;
 }
示例#2
0
 public function countStudentRepprovedCourseSubject($approved = null)
 {
     $c = new Criteria();
     $c->add(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, $this->getId());
     $c->addJoin(CourseSubjectStudentPeer::ID, StudentRepprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID);
     if (!is_null($approved)) {
         if ($approved) {
             $c->add(StudentRepprovedCourseSubjectPeer::STUDENT_APPROVED_CAREER_SUBJECT_ID, null, Criteria::ISNOTNULL);
         } else {
             $c->add(StudentRepprovedCourseSubjectPeer::STUDENT_APPROVED_CAREER_SUBJECT_ID, null, Criteria::ISNULL);
         }
     }
     return StudentRepprovedCourseSubjectPeer::doCount($c);
 }
示例#3
0
 public function getMessageCantExaminationRepproved()
 {
     if (!$this->getIsActive()) {
         return "The school year is not active";
     } elseif (StudentRepprovedCourseSubjectPeer::doCount(new Criteria()) <= 0) {
         return "No students to take examination repproved";
     }
 }
示例#4
0
 public function getCountStudentRepprovedCourseSubject()
 {
     $c = new Criteria();
     $c->addJoin(StudentRepprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID);
     $c->add(CourseSubjectStudentPeer::STUDENT_ID, $this->getId());
     $c->add(StudentRepprovedCourseSubjectPeer::STUDENT_APPROVED_CAREER_SUBJECT_ID, null, Criteria::ISNULL);
     return StudentRepprovedCourseSubjectPeer::doCount($c);
 }