/** * Retrieve a single, random user to start from. * * @param Criteria $crit * @return Douche */ public static function retrieveRandom(Criteria $crit = null) { if ($crit instanceof Criteria) { $c = clone $crit; } else { $c = new Criteria(); } $c->add(DouchePeer::TWITTER_FOLLOWERS, 4000, Criteria::GREATER_THAN); $total = self::doCount($c); $rand = rand(0, $total - 1); $c->setOffset($rand); return DouchePeer::doSelectOne($c); }