CommentArray class

Maintains an array of multiple Comment instances.

Serves as the value referenced when a FieldtypeComment field is reference from a Page.


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?       Only hookable?    

Common

NameReturnSummary 
CommentArray::getCommentForm()
CommentForm

Return instance of CommentForm object

 
CommentArray::getCommentList()
CommentList

Return instance of CommentList object

 
CommentArray::getField()
CommentField Field

Get the Field that these comments are on

 
CommentArray::getLimit()
int

Get the imposed limit on number of comments.

 
CommentArray::getPage()
Page

Get the page that these comments are on

 
CommentArray::getTotal()
int

Get the total number of comments

 
CommentArray::hasComment($comment)
bool

Does this CommentArray have the given Comment (or comment ID)?

 
CommentArray::isIdentical(WireArray $items)
bool

Is the given CommentArray identical to this one?

 
CommentArray::isValidItem($item)
bool

Per the WireArray interface, is the item a Comment

 
CommentArray::makeNew()
CommentArray

Make a new blank CommentArray setup for the same Page/Field as the one it is called on

 
CommentArray::render()
string

Provides the default rendering of a comment list, which may or may not be what you want

 
CommentArray::renderAll()
string

Render all comments and a comments form below it

 
CommentArray::renderForm()
string

Provides the default rendering of a comment form, which may or may not be what you want

 
CommentArray::renderStars()
string

Render combined star rating for all comments in this CommentsArray

 
CommentArray::setField($field)
None

Set the Field that these comments are on

 
CommentArray::setPage(Page $page)
None

Set the page that these comments are on

 
CommentArray::stars()
int float false array

Get 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.255