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 #550
    In the 550th issue of ProcessWire Weekly we're going to check out the latest core updates, introduce a new third party module called PagefileMetadata, and more. Read on!
    Weekly.pw / 23 November 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani