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 #518
    The 518th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 13 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH