From 2dd4004af95ab7e11813281c19a7e32aa0119e5a Mon Sep 17 00:00:00 2001 From: michael pereira Date: Fri, 1 Apr 2011 13:56:29 +0200 Subject: bootmenu --- application/models/BootOsMapper.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'application/models/BootOsMapper.php') diff --git a/application/models/BootOsMapper.php b/application/models/BootOsMapper.php index 74fced0..3ac2a8c 100644 --- a/application/models/BootOsMapper.php +++ b/application/models/BootOsMapper.php @@ -5,7 +5,7 @@ class Application_Model_BootOsMapper protected $_dbTable; - public function findBy($criteria, $value) + public function findBy($criteria, $value, $array=false) { try{ $db = Zend_Db_Table::getDefaultAdapter(); @@ -15,15 +15,18 @@ class Application_Model_BootOsMapper $stmt = $select->query(); $result = $stmt->fetchAll(); - $entries = array(); - foreach ($result as $row) { - $entry = new Application_Model_BootOs($row); - $entry->setID($row['bootosID']); - $entries[] = $entry; + if(!$array){ + $entries = array(); + foreach ($result as $row) { + $entry = new Application_Model_BootOs($row); + $entry->setID($row['bootosID']); + $entries[] = $entry; + } + return $entries; + }else{ + return $result; } - return $entries; - }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } -- cgit v1.2.3-55-g7522