From b8d83ec56889b1788e19b216637f77de56bc435d Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 11 Dec 2011 20:32:37 +0000 Subject: [PATCH] Adding a getDB function to ApiBase... Not all subclasses will need/want it. It does however make it easier to pretend non ApiQuery derivatives actually are... --- includes/api/ApiBase.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index c2cd22b7dd..2129052afd 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1498,6 +1498,13 @@ abstract class ApiBase extends ContextSource { return $this->mDBTime; } + /** + * @return DatabaseBase + */ + public function getDB() { + return wfGetDB( DB_SLAVE, 'api' ); + } + /** * Debugging function that prints a value and an optional backtrace * @param $value mixed Value to print -- 2.20.1