diff options
| author | michael pereira | 2011-03-22 12:31:56 +0100 |
|---|---|---|
| committer | michael pereira | 2011-03-22 12:31:56 +0100 |
| commit | 04475ff1a1df3a0cc523117e6288401808946d43 (patch) | |
| tree | 6ecb79417d6db5ca2c5de604df9f31c96c7ae74e /application/models/BootIsoMapper.php | |
| parent | Bootos fix (diff) | |
| download | pbs2-04475ff1a1df3a0cc523117e6288401808946d43.tar.gz pbs2-04475ff1a1df3a0cc523117e6288401808946d43.tar.xz pbs2-04475ff1a1df3a0cc523117e6288401808946d43.zip | |
Bootiso & Preboot update
Diffstat (limited to 'application/models/BootIsoMapper.php')
| -rw-r--r-- | application/models/BootIsoMapper.php | 12 |
1 files changed, 9 insertions, 3 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() |
