diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-11-13 20:00:40 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-11-13 20:00:40 +0000 |
commit | 641ab9d18a06e0a3a6368e5cc2113eaeb527c452 (patch) | |
tree | f2de8cd083e8fb8e34a2ad889a4b17660f3225de | |
parent | d141c366dbe8de39aa0477591d0e53cbda957894 (diff) | |
download | elgg-641ab9d18a06e0a3a6368e5cc2113eaeb527c452.tar.gz elgg-641ab9d18a06e0a3a6368e5cc2113eaeb527c452.tar.bz2 |
Properly ordering annotation objects returned by Elgg methods.
git-svn-id: http://code.elgg.org/elgg/trunk@3679 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/annotations.php | 13 |
1 files changed, 6 insertions, 7 deletions
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) { |