* aims to be both simple and very flexible. It is centered around an associative
* array of fields and various methods to do common interaction with the database.
*
+ * Documentation inline and at https://www.mediawiki.org/wiki/Manual:ORMTable
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* @file ORMRow.php
* @ingroup ORM
*
- * @licence GNU GPL v2 or later
+ * @license GNU GPL v2 or later
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
*
* @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
*
* @since 1.20
*
- * @param string$name
+ * @param $name string
*
* @return mixed
*/
* @return boolean Success indicator
*/
protected function saveExisting( $functionName = null ) {
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->table->getWriteDbConnection();
$success = $dbw->update(
$this->table->getName(),
* @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(),
$absoluteAmount = abs( $amount );
$isNegative = $amount < 0;
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->table->getWriteDbConnection();
$fullField = $this->table->getPrefixedField( $field );