public static function getForExpertCategory($iCategoryId) { $c = new criteria(); $c->addJoin(UserPeer::ID, ExpertCategoryPeer::USER_ID, Criteria::JOIN); $c->add(ExpertCategoryPeer::CATEGORY_ID, $iCategoryId); $c->addDescendingOrderbyColumn(UserPeer::POINTS); $c->setLimit(5); $c->setDistinct(); return UserPeer::doSelect($c); }