Created
June 25, 2012 21:22
-
-
Save mikebuchanon/2991341 to your computer and use it in GitHub Desktop.
seems to return a count of all comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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