Merge "mw.loader: Fixes for <script> and <link> loading."
[lhc/web/wiklou.git] / includes / db / ORMRow.php
index 303f3a2..1753afe 100644 (file)
@@ -27,7 +27,7 @@
  * @file ORMRow.php
  * @ingroup ORM
  *
- * @licence GNU GPL v2 or later
+ * @license GNU GPL v2 or later
  * @author Jeroen De Dauw < jeroendedauw@gmail.com >
  */
 
@@ -138,8 +138,9 @@ abstract class ORMRow implements IORMRow {
         *
         * @since 1.20
         *
-        * @param string $name
-        * @param mixed $default
+        * @param $name string: Field name
+        * @param $default mixed: Default value to return when none is found
+        * (default: null)
         *
         * @throws MWException
         * @return mixed
@@ -159,7 +160,7 @@ abstract class ORMRow implements IORMRow {
         *
         * @since 1.20
         *
-        * @param string$name
+        * @param $name string
         *
         * @return mixed
         */
@@ -346,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(),
@@ -382,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(),
@@ -557,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 );