I try developing two filter which order a list of groupforumtopics by the amount of answers and the amount of likes. I know the function: countAnnotations('likes') and countComments() but i have no idea how to use them. I use a switch case and depending on the input i create the $options array.
$options = array(
'type' => 'object',
'subtype' => 'groupforumtopic',
'limit' => 10,
'container_guid' => $guid,
'full_view' => FALSE,
);
$content = elgg_list_entities($options);
Does someone have a tip or better a solution?
Elgg likes and replies are annotations. So you have to use elgg_list_entities_from_annotation_calculation(). Its better to ask these type of questions in the elgg community forum, so that it will be helpful for others too.