From cc6b7d1d223241e397e0d41354924e74606eeffc Mon Sep 17 00:00:00 2001 From: brettp Date: Sat, 12 Feb 2011 22:39:46 +0000 Subject: Refs #650. Replaced calls to get_annotations() by elgg_get_annotations(). git-svn-id: http://code.elgg.org/elgg/trunk@8182 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggEntity.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'engine/classes/ElggEntity.php') diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index 8a7c45648..1154fd89a 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -519,13 +519,25 @@ abstract class ElggEntity extends ElggData implements * @param string $name Annotation name * @param int $limit Limit * @param int $offset Offset - * @param string $order asc or desc + * @param string $order Order by time: asc or desc * * @return array */ function getAnnotations($name, $limit = 50, $offset = 0, $order = "asc") { if ((int) ($this->guid) > 0) { - return get_annotations($this->getGUID(), "", "", $name, "", 0, $limit, $offset, $order); + + $options = array( + 'guid' => $this->guid, + 'annotation_name' => $name, + 'limit' => $limit, + 'offset' => $offset, + ); + + if ($order == 'desc') { + $options['order_by'] = 'n_table.time_created desc'; + } + + return elgg_get_annotations($options); } else { return $this->temp_annotations[$name]; } -- cgit v1.2.3