From 6e476cbdc86f66a154b6794967adaba1a2d0f004 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Tue, 5 Apr 2011 16:21:08 +0200 Subject: Rechte in Alle Controller --- application/models/BootMenuMapper.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'application/models/BootMenuMapper.php') diff --git a/application/models/BootMenuMapper.php b/application/models/BootMenuMapper.php index 60c506d..1043897 100644 --- a/application/models/BootMenuMapper.php +++ b/application/models/BootMenuMapper.php @@ -93,16 +93,23 @@ class Application_Model_BootMenuMapper } } - public function find($id, Application_Model_BootMenu $botmenu) + public function find($id, Application_Model_BootMenu $botmenu = null) { $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; } - $row = $result->current(); - $botmenu->setID($row->bootmenuID)->setMembershipID($row->membershipID)->setGroupID($row->groupID)->setTitle($row->title)->setCreated($row->created); + if($botmenu == null){ + $botmenu = new Application_Model_BootMenu(); + $botmenu->setID($row->bootmenuID)->setMembershipID($row->membershipID)->setGroupID($row->groupID)->setTitle($row->title)->setCreated($row->created); + return $botmenu; + }else{ + $botmenu->setID($row->bootmenuID)->setMembershipID($row->membershipID)->setGroupID($row->groupID)->setTitle($row->title)->setCreated($row->created); + } + + } public function fetchAll() -- cgit v1.2.3-55-g7522