]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Properly ordering annotation objects returned by Elgg methods.
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 13 Nov 2009 20:00:40 +0000 (20:00 +0000)
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 13 Nov 2009 20:00:40 +0000 (20:00 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3679 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/annotations.php

index 13d9bfdc54ed12128a730554baa22023202a0107..9e99d82f27c463710a415908e08edada805c9435 100644 (file)
@@ -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) {