From 7a7cbfb3b6e1f9143ac14edae92cc4b1ef5afcee Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 18 Aug 2008 06:50:12 +0000 Subject: [PATCH] Add optional $db param --- includes/Title.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index e643500bbb..ee5c658614 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3119,11 +3119,12 @@ class Title { /** * Get the last touched timestamp + * @param Database $db, optional db * @return \type{\string} Last touched timestamp */ - public function getTouched() { - $dbr = wfGetDB( DB_SLAVE ); - $touched = $dbr->selectField( 'page', 'page_touched', + public function getTouched( $db = NULL ) { + $db = isset($db) ? $db : wfGetDB( DB_SLAVE ); + $touched = $db->selectField( 'page', 'page_touched', array( 'page_namespace' => $this->getNamespace(), 'page_title' => $this->getDBkey() -- 2.20.1