예제 #1
0
 public static function doCountJoinAllExceptArticle(Criteria $criteria, $distinct = false, $con = null)
 {
     $criteria = clone $criteria;
     $criteria->clearSelectColumns()->clearOrderByColumns();
     if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
         $criteria->addSelectColumn(AuthorArticlePeer::COUNT_DISTINCT);
     } else {
         $criteria->addSelectColumn(AuthorArticlePeer::COUNT);
     }
     foreach ($criteria->getGroupByColumns() as $column) {
         $criteria->addSelectColumn($column);
     }
     $criteria->addJoin(AuthorArticlePeer::AUTHOR_ID, AuthorPeer::ID);
     $rs = AuthorArticlePeer::doSelectRS($criteria, $con);
     if ($rs->next()) {
         return $rs->getInt(1);
     } else {
         return 0;
     }
 }