CommentModel’s have the following attributes and methods:
|ID of the comment.|
|The element this comment was made on (Entry, Asset, etc).|
|UserModel(opens new window) for the author of a comment. For anonymous, this will still return a new UserModel, with their email, first/last name attributes populated.|
|CommentModel of comment responding to. Only applicable when replying to another comment. For new comments, this will be null.|
|The status of this comment. Available values are |
|Name of the commenter. Anonymous users only.|
|Email address of the commenter. Anonymous users only.|
|The URL that this comment was made from.|
|Commenters IP Address.|
|Commenters User Agent.|
|The comment text.|
|A collection of FlagModel’s for this comment.|
|A collection of VoteModel’s for this comment.|
|The total number of votes for this comment. Takes into account downvotes and upvotes.|
|Returns true/false if the current user can edit this comment.|
|Returns true/false if the current user can trash this comment.|
|Returns true/false if a comment was made by an anonymous user.|
|Comments can be closed for an element, allowing existing comments to be visible, but no new comments to be made. Editing, deleting and replying are disabled. This may also return true if you’ve set a value for ‘Auto-close comments’ in the plugin settings.|
|If a comment receives more than a certain amount of flags, |
isFlagged will be true. This limit is configurable through the plugin settings.
|Returns true if the user can vote on this comment. Must be a registered user and cannot be their own comment.|
canVote first, then checks to see if this user has already upvoted.
canVote first, then checks to see if this user has already downvoted.
|If a comment receives more than a certain amount of downvotes, |
isPoorlyRated will be true. This limit is configurable through the plugin settings.
|The url action end-point to trash a comment. This can be called directly, or via Ajax.|
|The url action end-point to record a flag on a comment. This can be called directly, or via Ajax.|
|The url action end-point to upvote a comment. This can be called directly, or via Ajax.|
|The url action end-point to downvote a comment. This can be called directly, or via Ajax.|