r77634 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77633‎ | r77634 | r77635 >
Date:02:05, 3 December 2010
Author:reedy
Status:ok
Tags:
Comment:
Add CodeRevision->getCommentCount() function

For bug 26061
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -541,6 +541,26 @@
542542 return $comments;
543543 }
544544
 545+ /*
 546+ * @return int
 547+ */
 548+ public function getCommentCount() {
 549+ $dbr = wfGetDB( DB_SLAVE );
 550+ $result = $dbr->select( 'code_comment',
 551+ array( 'cc_id' ),
 552+ array(
 553+ 'cc_repo_id' => $this->mRepoId,
 554+ 'cc_rev_id' => $this->mId ),
 555+ __METHOD__
 556+ );
 557+
 558+ if ( $result ) {
 559+ return intval( $result->comments );
 560+ } else {
 561+ return 0;
 562+ }
 563+ }
 564+
545565 public function getPropChanges() {
546566 $dbr = wfGetDB( DB_SLAVE );
547567 $result = $dbr->select( array( 'code_prop_changes', 'user' ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r77664*(bug 26061) CodeReview API need to give info for a list of revisionsreedy15:32, 3 December 2010

Status & tagging log