From: aude Date: Mon, 5 Nov 2012 19:57:47 +0000 (+0100) Subject: make ORMRow compatible with load balancer, replace usage of wfGetDB( DB_MASTER ) X-Git-Tag: 1.31.0-rc.0~21740 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=a883b5e91f3d35b96ba9ee04fbf54d15df085b88;p=lhc%2Fweb%2Fwiklou.git make ORMRow compatible with load balancer, replace usage of wfGetDB( DB_MASTER ) Change-Id: Ic9e728f8d2f83906fee6c4877296ad0759a7b539 --- diff --git a/includes/db/ORMRow.php b/includes/db/ORMRow.php index fa25868d7a..1753afe115 100644 --- a/includes/db/ORMRow.php +++ b/includes/db/ORMRow.php @@ -347,7 +347,7 @@ abstract class ORMRow implements IORMRow { * @return boolean Success indicator */ protected function saveExisting( $functionName = null ) { - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->table->getWriteDbConnection(); $success = $dbw->update( $this->table->getName(), @@ -383,7 +383,7 @@ abstract class ORMRow implements IORMRow { * @return boolean Success indicator */ protected function insert( $functionName = null, array $options = null ) { - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->table->getWriteDbConnection(); $success = $dbw->insert( $this->table->getName(), @@ -558,7 +558,7 @@ abstract class ORMRow implements IORMRow { $absoluteAmount = abs( $amount ); $isNegative = $amount < 0; - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->table->getWriteDbConnection(); $fullField = $this->table->getPrefixedField( $field );