public static function doCountJoinAllExceptClassGroup(Criteria $criteria, $distinct = false, $con = null) { $criteria = clone $criteria; $criteria->clearSelectColumns()->clearOrderByColumns(); if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { $criteria->addSelectColumn(AcademicCostPeer::COUNT_DISTINCT); } else { $criteria->addSelectColumn(AcademicCostPeer::COUNT); } foreach ($criteria->getGroupByColumns() as $column) { $criteria->addSelectColumn($column); } $criteria->addJoin(AcademicCostPeer::PAYER_TYPE_ID, PayerTypePeer::ID); $criteria->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $criteria->addJoin(AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID); $criteria->addJoin(AcademicCostPeer::ACADEMIC_PROCESS_ID, AcademicProcessPeer::ID); $criteria->addJoin(AcademicCostPeer::BANK_ACCOUNT_ID, BankAccountPeer::ID); $rs = AcademicCostPeer::doSelectRS($criteria, $con); if ($rs->next()) { return $rs->getInt(1); } else { return 0; } }