109 public function doQuery( array $userIds, $options = [], $caller =
'' ) {
113 $userIds = array_unique( $userIds );
115 foreach ( $userIds as $userId ) {
116 $userId = (int)$userId;
117 if ( $userId <= 0 ) {
120 if ( isset( $this->cache[$userId][
'name'] ) ) {
121 $usersToCheck[$userId] = $this->cache[$userId][
'name'];
123 $usersToQuery[] = $userId;
128 if ( count( $usersToQuery ) ) {
130 $tables = [
'user',
'actor' ];
131 $conds = [
'user_id' => $usersToQuery ];
132 $fields = [
'user_name',
'user_real_name',
'user_registration',
'user_id',
'actor_id' ];
134 'actor' => [
'JOIN',
'actor_user = user_id' ],
137 $comment = __METHOD__;
138 if ( strval( $caller ) !==
'' ) {
139 $comment .=
"/$caller";
142 $res =
$dbr->select( $tables, $fields, $conds, $comment, [], $joinConds );
143 foreach (
$res as $row ) {
144 $userId = (int)$row->user_id;
145 $this->cache[$userId][
'name'] = $row->user_name;
146 $this->cache[$userId][
'real_name'] = $row->user_real_name;
147 $this->cache[$userId][
'registration'] = $row->user_registration;
148 $this->cache[$userId][
'actor'] = $row->actor_id;
149 $usersToCheck[$userId] = $row->user_name;
153 $lb = $this->linkBatchFactory->newLinkBatch();
154 foreach ( $usersToCheck as $userId => $name ) {
155 if ( $this->
queryNeeded( $userId,
'userpage', $options ) ) {
157 $this->typesCached[$userId][
'userpage'] = 1;
159 if ( $this->
queryNeeded( $userId,
'usertalk', $options ) ) {
161 $this->typesCached[$userId][
'usertalk'] = 1;