Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -541,6 +541,26 @@ |
542 | 542 | return $comments; |
543 | 543 | } |
544 | 544 | |
| 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 | + |
545 | 565 | public function getPropChanges() { |
546 | 566 | $dbr = wfGetDB( DB_SLAVE ); |
547 | 567 | $result = $dbr->select( array( 'code_prop_changes', 'user' ), |