From 8289433a6af75839110b4cd318a1cfb11b44c133 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 6 May 2008 14:54:17 +0000 Subject: [PATCH] Add $flags, document --- includes/Title.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index d5d315c88c..70673acb37 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1891,11 +1891,16 @@ class Title { return $this->mLength; } - public function getLatestRevID() { + /** + * What is the page_latest field for this page? + * @param int $flags a bit field; may be GAID_FOR_UPDATE to select for update + * @return int + */ + public function getLatestRevID( $flags = 0 ) { if ($this->mLatestID !== false) return $this->mLatestID; - $db = wfGetDB(DB_SLAVE); + $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB(DB_MASTER) : wfGetDB(DB_SLAVE); return $this->mLatestID = $db->selectField( 'revision', "max(rev_id)", array('rev_page' => $this->getArticleID()), -- 2.20.1