r71648 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71647‎ | r71648 | r71649 >
Date:19:05, 25 August 2010
Author:reedy
Status:deferred
Tags:
Comment:
Update method names per r71634
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/api/ApiArticleAssessment.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/api/ApiArticleAssessment.php
@@ -51,15 +51,15 @@
5252 $pageId = $params['pageid'];
5353 $revisionId = $params['revisionid'];
5454
55 - $this->insertOnDupeUpdatePages( $pageId, $revisionId, $userName, 1, $m1, ( $m1 - $lastM1 ) );
56 - $this->insertOnDupeUpdatePages( $pageId, $revisionId, $userName, 2, $m1, ( $m2 - $lastM2 ) );
57 - $this->insertOnDupeUpdatePages( $pageId, $revisionId, $userName, 3, $m1, ( $m3 - $lastM3 ) );
58 - $this->insertOnDupeUpdatePages( $pageId, $revisionId, $userName, 4, $m1, ( $m4 - $lastM4 ) );
 55+ $this->insertOrUpdatePages( $pageId, $revisionId, $userName, 1, $m1, ( $m1 - $lastM1 ) );
 56+ $this->insertOrUpdatePages( $pageId, $revisionId, $userName, 2, $m1, ( $m2 - $lastM2 ) );
 57+ $this->insertOrUpdatePages( $pageId, $revisionId, $userName, 3, $m1, ( $m3 - $lastM3 ) );
 58+ $this->insertOrUpdatePages( $pageId, $revisionId, $userName, 4, $m1, ( $m4 - $lastM4 ) );
5959
6060 //Insert (or update) a users rating for a revision
6161 $dbw = wfGetDB( DB_MASTER );
6262
63 - $dbw->insertOnDupeUpdate( 'article_assessment',
 63+ $dbw->insertOrUpdate( 'article_assessment',
6464 array(
6565 'aa_page_id' => $pageId,
6666 'aa_user_text' => $userName,
@@ -87,10 +87,10 @@
8888 $this->getResult()->addValue( null, $this->getModuleName(), $r );
8989 }
9090
91 - private function insertOnDupeUpdatePages( $pageId, $revisionId, $dimension, $insertAddition, $updateAddition ) {
 91+ private function insertOrUpdatePages( $pageId, $revisionId, $dimension, $insertAddition, $updateAddition ) {
9292 $dbw = wfGetDB( DB_MASTER );
9393
94 - $dbw->insertOnDupeUpdate( 'article_assessment_pages',
 94+ $dbw->insertOrUpdate( 'article_assessment_pages',
9595 array(
9696 'aap_page_id' => $pageId,
9797 'aap_revision' => $revisionId,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71634Move insertOnDupeUpdate (and rename to insertOrUpdate) to DatabaseMysql. Add ...reedy17:45, 25 August 2010

Status & tagging log