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/BootMenuMapper.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'application/models/BootMenuMapper.php') diff --git a/application/models/BootMenuMapper.php b/application/models/BootMenuMapper.php index e26a9e1..c8065ec 100644 --- a/application/models/BootMenuMapper.php +++ b/application/models/BootMenuMapper.php @@ -5,7 +5,7 @@ class Application_Model_BootMenuMapper protected $_dbTable; - public function findBy($criteria, $value) + public function findBy($criteria, $value, $array=false) { try{ $db = Zend_Db_Table::getDefaultAdapter(); @@ -14,7 +14,19 @@ class Application_Model_BootMenuMapper ->where($criteria . ' = ?', $value); $stmt = $select->query(); $result = $stmt->fetchAll(); - return $result; + + if(!$array){ + $entries = array(); + foreach ($result as $row) { + $entry = new Application_Model_BootMenu($row); + $entry->setID($row['bootmenuID']); + $entries[] = $entry; + } + return $entries; + }else{ + return $result; + } + }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } -- cgit v1.2.3-55-g7522