CommentArray class

Located in file /wire/modules/Fieldtype/FieldtypeComments/CommentArray.php

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the CommentArray class also inherits all the methods and properties of: PaginatedArray, WireArray and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
CommentArray::getCommentForm()
CommentFormReturn instance of CommentForm object 
CommentArray::getCommentList()
CommentListReturn instance of CommentList object 
CommentArray::getField()
CommentField FieldGet the Field that these comments are on 
CommentArray::getLimit()
intGet the imposed limit on number of comments. 
CommentArray::getPage()
PageGet the page that these comments are on 
CommentArray::getTotal()
intGet the total number of comments 
CommentArray::hasComment($comment)
boolDoes this CommentArray have the given Comment (or comment ID)? 
CommentArray::isIdentical(WireArray $items)
boolIs the given CommentArray identical to this one? 
CommentArray::isValidItem($item)
boolPer the WireArray interface, is the item a Comment 
CommentArray::makeNew()
CommentArrayMake a new blank CommentArray setup for the same Page/Field as the one it is called on 
CommentArray::render()
stringProvides the default rendering of a comment list, which may or may not be what you want 
CommentArray::renderAll()
stringRender all comments and a comments form below it 
CommentArray::renderForm()
stringProvides the default rendering of a comment form, which may or may not be what you want 
CommentArray::renderStars()
stringRender combined star rating for all comments in this CommentsArray 
CommentArray::setField($field)
(nothing)Set the Field that these comments are on 
CommentArray::setPage(Page $page)
(nothing)Set the page that these comments are on 
CommentArray::stars()
int float false arrayGet an average of all star ratings for all comments in this CommentsArray 

Additional methods and properties

In addition to the methods and properties above, CommentArray also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #515
    In the 515th issue of ProcessWire Weekly we’ll check out the latest core updates, new modules, and more. Read on!
    Weekly.pw / 23 March 2024
  • Invoices Site Profile
    The new invoices site profile is a free invoicing application developed in ProcessWire. It enables you to create invoices, record payments to them, email invoices to clients, print invoices, and more. This post covers all the details.
    Blog / 15 March 2024
  • Subscribe to weekly ProcessWire news

I just love the easy and intuitive ProcessWire API. ProcessWire rocks!” —Jens Martsch, Web developer