);
}
+ /**
+ * Get the oldest revision timestamp of this page
+ *
+ * @return string, MW timestamp
+ */
+ public function getEarliestRevTime() {
+ $dbr = wfGetDB( DB_SLAVE );
+ if( $this->exists() ) {
+ $min = $dbr->selectField( 'revision',
+ 'MIN(rev_timestamp)',
+ array( 'rev_page' => $this->getArticleId() ),
+ __METHOD__ );
+ return wfTimestampOrNull( TS_MW, $min );
+ }
+ return null;
+ }
+
/**
* Get the number of revisions between the given revision IDs.
* Used for diffs and other things that really need it.
$wgOut->addHTML("<ul>");
$target = urlencode( $this->mTarget );
$remaining = $revisions->numRows();
- $earliestLiveTime = $this->getEarliestTime( $this->mTargetObj );
+ $earliestLiveTime = $this->mTargetObj->getEarliestRevTime();
while( $row = $revisions->fetchObject() ) {
$remaining--;
return "<li>$checkBox $revdlink $pageLink . . $userLink $data $comment</li>\n";
}
- private function getEarliestTime( $title ) {
- $dbr = wfGetDB( DB_SLAVE );
- if( $title->exists() ) {
- $min = $dbr->selectField( 'revision',
- 'MIN(rev_timestamp)',
- array( 'rev_page' => $title->getArticleId() ),
- __METHOD__ );
- return wfTimestampOrNull( TS_MW, $min );
- }
- return null;
- }
-
/**
* Fetch revision text link if it's available to all users
* @return string