diff options
author | Simon Holywell <[email protected]> | 2013-12-12 10:23:43 +0000 |
---|---|---|
committer | Simon Holywell <[email protected]> | 2013-12-12 10:23:43 +0000 |
commit | 33c5012712e70f327f24d75405c6fd69131b17df (patch) | |
tree | e803f0a32c956dfc140d62e0b6fb62f8c02c1748 /idiorm.php | |
parent | 3be516b440734811b58bb9d0b458a4109b49af71 (diff) |
Issue #156 findMany() returns only the last record in a set
Diffstat (limited to 'idiorm.php')
-rw-r--r-- | idiorm.php | 18 |
1 files changed, 1 insertions, 17 deletions
@@ -611,23 +611,7 @@ */ protected function _find_many() { $rows = $this->_run(); - return $this->_instances_with_id_as_key($rows); - } - - /** - * Create instances of each row in the result and map - * them to an associative array with the primary IDs as - * the array keys. - * @param array $rows - * @return array - */ - protected function _instances_with_id_as_key($rows) { - $instances = array(); - foreach($rows as $row) { - $row = $this->_create_instance_from_row($row); - $instances[$row->id()] = $row; - } - return $instances; + return array_map(array($this, '_create_instance_from_row'), $rows); } /** |