From 7bfb4f195121008471974490ae24a86f2a450951 Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 22 Dec 2017 11:05:31 +0000 Subject: [PATCH] [MCR] Add optional $title param to Revision byId methods Bug: T183505 Change-Id: I714ee391caac9bc56ce4c037967e424b44d9c2fe --- includes/Revision.php | 7 ++++--- includes/Storage/RevisionStore.php | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/Revision.php b/includes/Revision.php index c7c708ea63..54558a4931 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -90,11 +90,12 @@ class Revision implements IDBAccessObject { * * @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 ); } /** diff --git a/includes/Storage/RevisionStore.php b/includes/Storage/RevisionStore.php index b8debb8b6a..24b437f98f 100644 --- a/includes/Storage/RevisionStore.php +++ b/includes/Storage/RevisionStore.php @@ -848,10 +848,11 @@ class RevisionStore implements IDBAccessObject, RevisionFactory, RevisionLookup * * @param int $id * @param int $flags (optional) + * @param Title $title (optional) * @return RevisionRecord|null */ - public function getRevisionById( $id, $flags = 0 ) { - return $this->newRevisionFromConds( [ 'rev_id' => intval( $id ) ], $flags ); + public function getRevisionById( $id, $flags = 0, Title $title = null ) { + return $this->newRevisionFromConds( [ 'rev_id' => intval( $id ) ], $flags, $title ); } /** -- 2.20.1