39 foreach ( $users as $user ) {
41 $timestampsById[$user->getId()] =
null;
44 $batches = array_chunk( array_keys( $timestampsById ), 1_000 );
46 $dbr = $this->connectionProvider->getReplicaDatabase();
48 foreach ( $batches as $userIdBatch ) {
49 $res = $dbr->newSelectQueryBuilder()
50 ->select( [
'user_id',
'user_registration' ] )
52 ->where( [
'user_id' => $userIdBatch ] )
53 ->caller( __METHOD__ )
56 foreach ( $res as $row ) {
57 $timestampsById[$row->user_id] =
wfTimestampOrNull( TS_MW, $row->user_registration );
61 return $timestampsById;