Add optional $db param
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 18 Aug 2008 06:50:12 +0000 (06:50 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 18 Aug 2008 06:50:12 +0000 (06:50 +0000)
includes/Title.php

index e643500..ee5c658 100644 (file)
@@ -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()