[MCR] Add optional $title param to Revision byId methods
authoraddshore <addshorewiki@gmail.com>
Fri, 22 Dec 2017 11:05:31 +0000 (11:05 +0000)
committerAddshore <addshorewiki@gmail.com>
Fri, 22 Dec 2017 12:33:23 +0000 (12:33 +0000)
Bug: T183505
Change-Id: I714ee391caac9bc56ce4c037967e424b44d9c2fe

includes/Revision.php
includes/Storage/RevisionStore.php

index c7c708e..54558a4 100644 (file)
@@ -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 );
        }
 
        /**
index b8debb8..24b437f 100644 (file)
@@ -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 );
        }
 
        /**