diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/deprecated-1.8.php | 16 |
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 |