PHP Templating API: getComments()
Posted by Mark [Elevated X Support], Last modified by AJ Hall on 30 October 2017 12:30 PM


The getComments() function gets a list of comments that are present in the system. Based on the arguments that are passed to it will determine which and how many comments are returned.

Sample Usage:

$commentobj = $api->getComments("contenttype" => "set");

$commentobj = $api->getComments(["id" => 1, "contenttype" => "set]);

$commentobj = $api->getComments([
"contenttype" => "set",
"sort" => "id",
"sort_reverse" => 1,
"countonly" => 0,

echo "\nNumber of comments returned: " . $commentobj->commentcount;
echo "\nComments:\n";

Returning Attributes:

This function call will return a StdObject object with the following attributes:


This is a multi-dimensional array that returns any comments that match search criteria.


The number of comments returned.



This specifies the type of comment that is being fetched. This field is required.

Valid values for this field are: set, news, model, dvd, custompages, store


This filters the results by model id. If set, this will only return a set of the specified model id, if it is available for release and is present on the current site.


Specify sorting order of comments.

Valid values are: id

By default, the system will sort by id.

Note: Future sorting options will be available in a future API release.


If this is set to 1, reverse the sorting order as specified within "sort"


If specified, only return the number of areas that fit the search criteria.

(0 vote(s))
Not helpful

Comments (0)