aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-20 04:24:32 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-20 04:24:32 +0000
commit9b2785069c13ed320e369670a69ba0695526ba7e (patch)
tree9009b2e2b85be6b1be64534f06cdaee1850ec2b7 /engine/lib
parentbd7b8852e986dc2cb8a59c9735d811ce6bd27afc (diff)
downloadelgg-9b2785069c13ed320e369670a69ba0695526ba7e.tar.gz
elgg-9b2785069c13ed320e369670a69ba0695526ba7e.tar.bz2
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
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/deprecated-1.8.php16
1 files changed, 16 insertions, 0 deletions
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