Ejemplo n.º 1
0
 public static function doCountJoinAllExceptCountryRelatedByCountryId(Criteria $criteria, $distinct = false, $con = null)
 {
     $criteria = clone $criteria;
     $criteria->clearSelectColumns()->clearOrderByColumns();
     if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
         $criteria->addSelectColumn(StudentDetailPeer::COUNT_DISTINCT);
     } else {
         $criteria->addSelectColumn(StudentDetailPeer::COUNT);
     }
     foreach ($criteria->getGroupByColumns() as $column) {
         $criteria->addSelectColumn($column);
     }
     $criteria->addJoin(StudentDetailPeer::REGION_ID, RegionPeer::ID);
     $criteria->addJoin(StudentDetailPeer::RELIGION_ID, ReligionPeer::ID);
     $criteria->addJoin(StudentDetailPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $criteria->addJoin(StudentDetailPeer::ACCEPTANCE_CLASS, ClassGroupPeer::ID);
     $rs = StudentDetailPeer::doSelectRS($criteria, $con);
     if ($rs->next()) {
         return $rs->getInt(1);
     } else {
         return 0;
     }
 }