diff options
| author | Simon | 2011-03-22 13:10:17 +0100 |
|---|---|---|
| committer | Simon | 2011-03-22 13:10:17 +0100 |
| commit | 3e896c063bdb97e4e654379cdb36242798a8c07b (patch) | |
| tree | afa68a5d84fc45c1b2ae117662e8bda21dc8940f /application/models | |
| parent | FBGui verschönert, Css geadded, KioskModus vorbereitet (diff) | |
| parent | fbgui index merge (diff) | |
| download | pbs2-3e896c063bdb97e4e654379cdb36242798a8c07b.tar.gz pbs2-3e896c063bdb97e4e654379cdb36242798a8c07b.tar.xz pbs2-3e896c063bdb97e4e654379cdb36242798a8c07b.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/models')
| -rw-r--r-- | application/models/BootIsoMapper.php | 12 | ||||
| -rw-r--r-- | application/models/BootOsMapper.php | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/application/models/BootIsoMapper.php b/application/models/BootIsoMapper.php index 9e5b3db..8d883af 100644 --- a/application/models/BootIsoMapper.php +++ b/application/models/BootIsoMapper.php @@ -51,7 +51,7 @@ class Application_Model_BootIsoMapper if (null === ($id = $botiso->getID()) ) { unset($data['bootisoID']); - $this->getDbTable()->insert($data); + return $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('bootisoID = ?' => $id)); } @@ -66,7 +66,7 @@ class Application_Model_BootIsoMapper } } - public function find($id, Application_Model_BootIso $botiso) + public function find($id, Application_Model_BootIso $botiso = null) { $result = $this->getDbTable()->find($id); if (0 == count($result)) { @@ -75,7 +75,13 @@ class Application_Model_BootIsoMapper $row = $result->current(); - $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public); + if($botiso == null){ + $botiso = new Application_Model_BootIso(); + $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public); + return $botiso; + }else{ + $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public); + } } public function fetchAll() 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() |
