From 01da64858b8624588d5da7bd44763e55b41eefdf Mon Sep 17 00:00:00 2001 From: michael pereira Date: Tue, 22 Mar 2011 12:29:36 +0100 Subject: Bootos fix --- application/models/BootOsMapper.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'application/models') diff --git a/application/models/BootOsMapper.php b/application/models/BootOsMapper.php index fab73f2..1856384 100644 --- a/application/models/BootOsMapper.php +++ b/application/models/BootOsMapper.php @@ -66,7 +66,7 @@ class Application_Model_BootOsMapper } } - public function find($id) + public function find($id, Application_Model_BootOs $botos = null) { $botos = new Application_Model_BootOs(); $result = $this->getDbTable()->find($id); @@ -76,8 +76,14 @@ class Application_Model_BootOsMapper $row = $result->current(); - $botos->setID($row->bootosID)->setConfigID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPath_init($row->path_init)->setPath_kernel($row->path_kernel)->setDefaultkcl($row->defaultkcl)->setCreated($row->created)->setDescription($row->description)->setExpires($row->expires)->setPublic($row->public); - return $botos; + if($botos == null){ + $botos = new Application_Model_BootOs(); + $botos->setID($row->bootosID)->setConfigID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPath_init($row->path_init)->setPath_kernel($row->path_kernel)->setDefaultkcl($row->defaultkcl)->setCreated($row->created)->setDescription($row->description)->setExpires($row->expires)->setPublic($row->public); + return $botos; + }else{ + $botos->setID($row->bootosID)->setConfigID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPath_init($row->path_init)->setPath_kernel($row->path_kernel)->setDefaultkcl($row->defaultkcl)->setCreated($row->created)->setDescription($row->description)->setExpires($row->expires)->setPublic($row->public); + } + } public function fetchAll() -- cgit v1.2.3-55-g7522