*
* @param int $id
* @param int $flags (optional)
+ * @param Title $title (optional)
* @return Revision|null
*/
- public static function newFromId( $id, $flags = 0 ) {
- $rec = self::getRevisionStore()->getRevisionById( $id, $flags );
- return $rec === null ? null : new Revision( $rec, $flags );
+ public static function newFromId( $id, $flags = 0, Title $title = null ) {
+ $rec = self::getRevisionStore()->getRevisionById( $id, $flags, $title );
+ return $rec === null ? null : new Revision( $rec, $flags, $title );
}
/**
*
* @param object $row
* @param array $overrides
+ * @param Title $title (optional)
*
* @throws MWException
* @return Revision
*/
- public static function newFromArchiveRow( $row, $overrides = [] ) {
- $rec = self::getRevisionStore()->newRevisionFromArchiveRow( $row, 0, null, $overrides );
- return new Revision( $rec );
+ public static function newFromArchiveRow( $row, $overrides = [], Title $title = null ) {
+ $rec = self::getRevisionStore()->newRevisionFromArchiveRow( $row, 0, $title, $overrides );
+ return new Revision( $rec, self::READ_NORMAL, $title );
}
/**
* @return Revision|null
*/
public function getPrevious() {
- $rec = self::getRevisionStore()->getPreviousRevision( $this->mRecord );
- return $rec === null ? null : new Revision( $rec );
+ $rec = self::getRevisionStore()->getPreviousRevision( $this->mRecord, $this->getTitle() );
+ return $rec === null
+ ? null
+ : new Revision( $rec, self::READ_NORMAL, $this->getTitle() );
}
/**
* @return Revision|null
*/
public function getNext() {
- $rec = self::getRevisionStore()->getNextRevision( $this->mRecord );
- return $rec === null ? null : new Revision( $rec );
+ $rec = self::getRevisionStore()->getNextRevision( $this->mRecord, $this->getTitle() );
+ return $rec === null
+ ? null
+ : new Revision( $rec, self::READ_NORMAL, $this->getTitle() );
}
/**