$this->profileOut();
}
+ /**
+ * Initialize PageSet from a list of Revision IDs
+ */
+ public function populateFromRevisionIDs($revIDs) {
+ $this->profileIn();
+ $pageIDs = array_map('intval', $revIDs); // paranoia
+ $this->initFromRevIDs($revIDs);
+ $this->profileOut();
+ }
+
/**
* Extract all requested fields from the row received from the database
*/
// Get validated and normalized title objects
$linkBatch = $this->processTitlesStrArray($titles);
+ if($linkBatch->isEmpty())
+ return;
+
$set = $linkBatch->constructSet('page', $db);
// Get pageIDs data from the `page` table
}
private function initFromPageIds($pageids) {
+ if(empty($pageids))
+ return;
+
$db = $this->getDB();
-
$set = array (
'page_id' => $pageids
);
private function initFromRevIDs($revids) {
+ if(empty($revids))
+ return;
+
$db = $this->getDB();
$pageids = array();
$remaining = array_flip($revids);
- $tables = array('page', 'revision');
+ $tables = array('revision');
$fields = array('rev_id','rev_page');
- $where = array( 'rev_deleted' => 0, 'rev_id' => $revids );
+ $where = array('rev_deleted' => 0, 'rev_id' => $revids);
// Get pageIDs data from the `page` table
$this->profileDBIn();
// Populate all the page information
if($this->mResolveRedirects)
$this->dieDebug('revids may not be used with redirect resolution');
- $pageids = array_keys($pageids);
- if(!empty($pageids))
- $this->initFromPageIds($pageids);
+ $this->initFromPageIds(array_keys($pageids));
}
private function resolvePendingRedirects() {