diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-12 22:39:46 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-12 22:39:46 +0000 |
commit | cc6b7d1d223241e397e0d41354924e74606eeffc (patch) | |
tree | 0ab9761a9b4db387edd3f3b17568bbee1c2b78c6 /engine/classes | |
parent | ca9ed0b16163dcf77154c0adc702e9f4c63df13c (diff) | |
download | elgg-cc6b7d1d223241e397e0d41354924e74606eeffc.tar.gz elgg-cc6b7d1d223241e397e0d41354924e74606eeffc.tar.bz2 |
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
Diffstat (limited to 'engine/classes')
-rw-r--r-- | engine/classes/ElggEntity.php | 16 |
1 files changed, 14 insertions, 2 deletions
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]; } |