]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #1411: Can specify custom row callbacks with 'row_callback' options in elgg_get_...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 9 Dec 2010 19:51:49 +0000 (19:51 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 9 Dec 2010 19:51:49 +0000 (19:51 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7585 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/entities.php

index 463dfefc086030b9d8c4816b0884f01505c7281c..c09cdc829f7891fcbefbf06bdf05542fc8fc6933 100644 (file)
@@ -725,6 +725,8 @@ function get_entity($guid) {
  *
  *     joins => array() Additional joins
  *
+ *     row_callback => string A callback function to pass each row through
+ *
  * @return mixed int if count is true, an array of entity objects, or false on failure
  * @since 1.7.0
  * @see elgg_get_entities_from_metadata()
@@ -759,7 +761,9 @@ function elgg_get_entities(array $options = array()) {
                'count'                                 =>      FALSE,
                'selects'                               =>      array(),
                'wheres'                                =>      array(),
-               'joins'                                 =>      array()
+               'joins'                                 =>      array(),
+
+               'row_callback'                  => 'entity_row_to_elggstar',
        );
 
        $options = array_merge($defaults, $options);
@@ -870,7 +874,7 @@ function elgg_get_entities(array $options = array()) {
                        $query .= " LIMIT $offset, $limit";
                }
 
-               $dt = get_data($query, "entity_row_to_elggstar");
+               $dt = get_data($query, $options['row_callback']);
 
                //@todo normalize this to array()
                return $dt;