From 641ab9d18a06e0a3a6368e5cc2113eaeb527c452 Mon Sep 17 00:00:00 2001 From: nickw Date: Fri, 13 Nov 2009 20:00:40 +0000 Subject: Properly ordering annotation objects returned by Elgg methods. git-svn-id: http://code.elgg.org/elgg/trunk@3679 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/annotations.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'engine') diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 13d9bfdc5..9e99d82f2 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -424,7 +424,9 @@ function elgg_get_entities_from_annotations(array $options = array()) { 'annotation_name_value_pair' => NULL, 'annotation_name_value_pairs' => NULL, 'annotation_name_value_pairs_operator' => 'AND', - 'annotation_case_sensitive' => TRUE + 'annotation_case_sensitive' => TRUE, + 'order_by' => 'maxtime desc', + 'group_by' => 'a.entity_guid' ); $options = array_merge($defaults, $options); @@ -463,13 +465,14 @@ function elgg_get_entities_from_annotations(array $options = array()) { $options['selects'] = array_merge($options['selects'], $clauses['selects']); - // @todo overwrites the current order and group bys + /* @todo overwrites the current order and group bys if ($clauses['order_by']) { $options['order_by'] = $clauses['order_by']; } if ($clauses['group_by']) { $options['group_by'] = $clauses['group_by']; } + */ } return elgg_get_entities($options); @@ -722,11 +725,7 @@ function get_entities_from_annotations($entity_type = "", $entity_subtype = "", } if ($order_by) { - $options['order_by']; - } - - if ($site_guid) { - $options['site_guid']; + $options['order_by'] = "maxtime $order_by"; } if ($count) { -- cgit v1.2.3