/** * @param ChangesList $list * @param ResultWrapper|array $rows * * @return bool */ public function doChangesListInitRows(ChangesList $list, $rows) { try { $titles = $this->getChangedTitles($rows); $entityIds = $this->idLookup->getEntityIds($titles); $this->buffer->prefetchTerms($entityIds, $this->termTypes, $this->languageCodes); } catch (StorageException $ex) { wfLogWarning(__METHOD__ . ': ' . $ex->getMessage()); } return true; }
/** * @param Title[] $titles * @param int|null $continue * * @return array */ private function getEntityIdsForTitles(array $titles, $continue = 0) { $entityIds = $this->idLookup->getEntityIds($titles); // Re-sort, so the order of page IDs matches the order in which $titles // were given. This is essential for paging to work properly. // This also skips all page IDs up to $continue. $sortedEntityId = array(); foreach ($titles as $pid => $title) { if ($pid >= $continue && isset($entityIds[$pid])) { $sortedEntityId[$pid] = $entityIds[$pid]; } } return $sortedEntityId; }