From 9b2785069c13ed320e369670a69ba0695526ba7e Mon Sep 17 00:00:00 2001 From: brettp Date: Sun, 20 Mar 2011 04:24:32 +0000 Subject: Fixes #3190. Added elgg_count_comments() to deprecated-1.8.php. git-svn-id: http://code.elgg.org/elgg/trunk@8779 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/deprecated-1.8.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engine') diff --git a/engine/lib/deprecated-1.8.php b/engine/lib/deprecated-1.8.php index 2f082c08b..2e97eb81d 100644 --- a/engine/lib/deprecated-1.8.php +++ b/engine/lib/deprecated-1.8.php @@ -4419,4 +4419,20 @@ function db_upgrade($version, $fromdir = "", $quiet = FALSE) { } return TRUE; +} + +/** + * Count the number of comments attached to an entity + * + * @param ElggEntity $entity + * @return int Number of comments + */ +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; } \ No newline at end of file -- cgit v1.2.3