summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorSimon Holywell <[email protected]>2013-12-12 10:23:43 +0000
committerSimon Holywell <[email protected]>2013-12-12 10:23:43 +0000
commit33c5012712e70f327f24d75405c6fd69131b17df (patch)
treee803f0a32c956dfc140d62e0b6fb62f8c02c1748 /idiorm.php
parent3be516b440734811b58bb9d0b458a4109b49af71 (diff)
Issue #156 findMany() returns only the last record in a set
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php18
1 files changed, 1 insertions, 17 deletions
diff --git a/idiorm.php b/idiorm.php
index dd5cea2..7ac1652 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -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);
}
/**