Index: trunk/extensions/ArticleAssessmentPilot/api/ApiArticleAssessment.php |
— | — | @@ -51,15 +51,15 @@ |
52 | 52 | $pageId = $params['pageid']; |
53 | 53 | $revisionId = $params['revisionid']; |
54 | 54 | |
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 ) ); |
59 | 59 | |
60 | 60 | //Insert (or update) a users rating for a revision |
61 | 61 | $dbw = wfGetDB( DB_MASTER ); |
62 | 62 | |
63 | | - $dbw->insertOnDupeUpdate( 'article_assessment', |
| 63 | + $dbw->insertOrUpdate( 'article_assessment', |
64 | 64 | array( |
65 | 65 | 'aa_page_id' => $pageId, |
66 | 66 | 'aa_user_text' => $userName, |
— | — | @@ -87,10 +87,10 @@ |
88 | 88 | $this->getResult()->addValue( null, $this->getModuleName(), $r ); |
89 | 89 | } |
90 | 90 | |
91 | | - private function insertOnDupeUpdatePages( $pageId, $revisionId, $dimension, $insertAddition, $updateAddition ) { |
| 91 | + private function insertOrUpdatePages( $pageId, $revisionId, $dimension, $insertAddition, $updateAddition ) { |
92 | 92 | $dbw = wfGetDB( DB_MASTER ); |
93 | 93 | |
94 | | - $dbw->insertOnDupeUpdate( 'article_assessment_pages', |
| 94 | + $dbw->insertOrUpdate( 'article_assessment_pages', |
95 | 95 | array( |
96 | 96 | 'aap_page_id' => $pageId, |
97 | 97 | 'aap_revision' => $revisionId, |