Beispiel #1
0
 public static function doCountJoinAllExceptEmployee(Criteria $criteria, $distinct = false, $con = null)
 {
     $criteria = clone $criteria;
     $criteria->clearSelectColumns()->clearOrderByColumns();
     if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
         $criteria->addSelectColumn(ClassAgendaPeer::COUNT_DISTINCT);
     } else {
         $criteria->addSelectColumn(ClassAgendaPeer::COUNT);
     }
     foreach ($criteria->getGroupByColumns() as $column) {
         $criteria->addSelectColumn($column);
     }
     $criteria->addJoin(ClassAgendaPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID);
     $criteria->addJoin(ClassAgendaPeer::CLASS_SESSION_ID, ClassSessionPeer::ID);
     $criteria->addJoin(ClassAgendaPeer::SUBJECT_GRADING_ID, SubjectGradingPeer::ID);
     $criteria->addJoin(ClassAgendaPeer::STUDENT_ID, StudentPeer::ID);
     $criteria->addJoin(ClassAgendaPeer::STUDENT_ABSENCE_ID, StudentAbsencePeer::ID);
     $criteria->addJoin(ClassAgendaPeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $criteria->addJoin(ClassAgendaPeer::SCHEDULE_ID, SchedulePeer::ID);
     $rs = ClassAgendaPeer::doSelectRS($criteria, $con);
     if ($rs->next()) {
         return $rs->getInt(1);
     } else {
         return 0;
     }
 }