| @@ 648-654 (lines=7) @@ | ||
| 645 | $set = "(" . implode(',', $guids) . ")"; |
|
| 646 | $sql = "SELECT * FROM {$dbprefix}{$type}s_entity WHERE guid IN $set"; |
|
| 647 | $secondary_rows = _elgg_services()->db->getData($sql); |
|
| 648 | if ($secondary_rows) { |
|
| 649 | foreach ($secondary_rows as $secondary_row) { |
|
| 650 | $key = $guid_to_key[$secondary_row->guid]; |
|
| 651 | // cast to arrays to merge then cast back |
|
| 652 | $rows[$key] = (object)array_merge((array)$rows[$key], (array)$secondary_row); |
|
| 653 | } |
|
| 654 | } |
|
| 655 | } |
|
| 656 | } |
|
| 657 | // Second pass to finish conversion |
|
| @@ 137-143 (lines=7) @@ | ||
| 134 | $set = "(" . implode(',', $guids) . ")"; |
|
| 135 | $sql = "SELECT guid, title FROM {$dbprefix}{$type}s_entity WHERE guid IN $set"; |
|
| 136 | $secondary_rows = _elgg_services()->db->getData($sql); |
|
| 137 | if ($secondary_rows) { |
|
| 138 | foreach ($secondary_rows as $secondary_row) { |
|
| 139 | $key = $guid_to_key[$secondary_row->guid]; |
|
| 140 | // cast to arrays to merge then cast back |
|
| 141 | $rows[$key] = (object)array_merge((array)$rows[$key], (array)$secondary_row); |
|
| 142 | } |
|
| 143 | } |
|
| 144 | } |
|
| 145 | else { |
|
| 146 | $set = "(" . implode(',', $guids) . ")"; |
|
| @@ 149-155 (lines=7) @@ | ||
| 146 | $set = "(" . implode(',', $guids) . ")"; |
|
| 147 | $sql = "SELECT * FROM {$dbprefix}{$type}s_entity WHERE guid IN $set"; |
|
| 148 | $secondary_rows = _elgg_services()->db->getData($sql); |
|
| 149 | if ($secondary_rows) { |
|
| 150 | foreach ($secondary_rows as $secondary_row) { |
|
| 151 | $key = $guid_to_key[$secondary_row->guid]; |
|
| 152 | // cast to arrays to merge then cast back |
|
| 153 | $rows[$key] = (object)array_merge((array)$rows[$key], (array)$secondary_row); |
|
| 154 | } |
|
| 155 | } |
|
| 156 | } |
|
| 157 | } |
|
| 158 | } |
|