public function getRevisions() { if ($this->pageData === null) { // Previous revisions of the header are preserved in the underlying wikitext // page history. Only the top revision is imported. $response = $this->api->retrieveTopRevisionByTitle(array($this->title)); $this->pageData = reset($response); } $revisions = array(); if (isset($this->pageData['revisions']) && count($this->pageData['revisions']) > 0) { $lastLqtRevision = new ImportRevision(end($this->pageData['revisions']), $this, $this->source->getScriptUser()); $titleObject = Title::newFromText($this->title); $cleanupRevision = $this->createHeaderCleanupRevision($lastLqtRevision, $titleObject); $revisions = array($lastLqtRevision, $cleanupRevision); } return new ArrayIterator($revisions); }
public function __construct(User $user = null) { parent::__construct(); $this->user = $user; }