countComments() public method

Count the number of comments attached to this entity.
Since: 1.8.0
public countComments ( ) : integer
return integer Number of comments
Example #1
0
/**
 * Count the number of comments attached to an entity
 *
 * @param ElggEntity $entity
 * @return int Number of comments
 * @deprecated 1.8 Use ElggEntity->countComments()
 */
function elgg_count_comments($entity)
{
    elgg_deprecated_notice('elgg_count_comments() is deprecated by ElggEntity->countComments()', 1.8);
    if ($entity instanceof ElggEntity) {
        return $entity->countComments();
    }
    return 0;
}