Skip to content

Instantly share code, notes, and snippets.

@mikebuchanon
Created June 25, 2012 21:22
Show Gist options
  • Save mikebuchanon/2991341 to your computer and use it in GitHub Desktop.
Save mikebuchanon/2991341 to your computer and use it in GitHub Desktop.
seems to return a count of all comments
public function count() {
global $DB;
if ($this->totalcommentcount === null) {
$this->totalcommentcount = $DB->count_records('comments', array('itemid' => $this->itemid, 'commentarea' => $this->commentarea, 'contextid' => $this->context->id));
}
return $this->totalcommentcount;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment