diff options
author | Steve Clay <steve@mrclay.org> | 2013-02-04 20:55:04 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2013-02-09 08:10:40 -0500 |
commit | 78e0ec583619cbb728cbe03df857c8219acaac7e (patch) | |
tree | 785ec0f364fa5f42b1bf5c82dbbf2d7d88cddf27 /engine/lib/entities.php | |
parent | f416d7ba66000d485260a8e63962541afa248320 (diff) | |
download | elgg-78e0ec583619cbb728cbe03df857c8219acaac7e.tar.gz elgg-78e0ec583619cbb728cbe03df857c8219acaac7e.tar.bz2 |
simplify flow, style
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 0361ae195..e3535c741 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1120,16 +1120,17 @@ function _elgg_fetch_entities_from_sql($sql) { // Do secondary queries and merge rows if ($lookup_types) { $dbprefix = elgg_get_config('dbprefix'); - } - foreach ($lookup_types as $type => $guids) { - $set = "(" . implode(',', $guids) . ")"; - $sql = "SELECT * FROM {$dbprefix}{$type}s_entity WHERE guid IN $set"; - $secondary_rows = get_data($sql); - if ($secondary_rows) { - foreach ($secondary_rows as $secondary_row) { - $key = $guid_to_key[$secondary_row->guid]; - // cast to arrays to merge then cast back - $rows[$key] = (object)array_merge((array)$rows[$key], (array)$secondary_row); + + foreach ($lookup_types as $type => $guids) { + $set = "(" . implode(',', $guids) . ")"; + $sql = "SELECT * FROM {$dbprefix}{$type}s_entity WHERE guid IN $set"; + $secondary_rows = get_data($sql); + if ($secondary_rows) { + foreach ($secondary_rows as $secondary_row) { + $key = $guid_to_key[$secondary_row->guid]; + // cast to arrays to merge then cast back + $rows[$key] = (object)array_merge((array)$rows[$key], (array)$secondary_row); + } } } } |