diff options
| author | michael pereira | 2011-03-08 20:57:39 +0100 |
|---|---|---|
| committer | michael pereira | 2011-03-08 20:57:39 +0100 |
| commit | 8f5309d8b3764d463f2a1c5da34eeb59261c2260 (patch) | |
| tree | 4c9aceb27e40075316ef1124de2071e40e01e404 /application/models | |
| parent | Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-8f5309d8b3764d463f2a1c5da34eeb59261c2260.tar.gz pbs2-8f5309d8b3764d463f2a1c5da34eeb59261c2260.tar.xz pbs2-8f5309d8b3764d463f2a1c5da34eeb59261c2260.zip | |
BootMenu Order fertig
Diffstat (limited to 'application/models')
| -rw-r--r-- | application/models/BootMenuEntriesMapper.php | 11 | ||||
| -rw-r--r-- | application/models/BootOsMapper.php | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/application/models/BootMenuEntriesMapper.php b/application/models/BootMenuEntriesMapper.php index a837dca..7a2da59 100644 --- a/application/models/BootMenuEntriesMapper.php +++ b/application/models/BootMenuEntriesMapper.php @@ -80,12 +80,20 @@ class Application_Model_BootMenuEntriesMapper $stmt = $db->query("UPDATE pbs_bootmenuentries SET `order` = `order` - 1 WHERE `order` > ". $botmenuentries->getOrder() . " AND `bootmenuID` = " . $botmenuentries->getBootmenuID()); } - public function orderedit(Application_Model_BootMenuEntries $botmenuentries, $oldval) + public function orderbefore(Application_Model_BootMenuEntries $botmenuentries, $oldval) { $db = Zend_Db_Table::getDefaultAdapter(); + print_a($botmenuentries, $oldval); $stmt = $db->query("UPDATE pbs_bootmenuentries SET `order` = `order` + 1 WHERE `order` >= ". $botmenuentries->getOrder() . " AND `order` < " . $oldval . " AND `bootmenuID` = " . $botmenuentries->getBootmenuID()); } + public function orderafter(Application_Model_BootMenuEntries $botmenuentries, $oldval) + { + $db = Zend_Db_Table::getDefaultAdapter(); + print_a($botmenuentries, $oldval); + $stmt = $db->query("UPDATE pbs_bootmenuentries SET `order` = `order` - 1 WHERE `order` <= ". $botmenuentries->getOrder() . " AND `order` > " . $oldval . " AND `bootmenuID` = " . $botmenuentries->getBootmenuID()); + } + public function delete(Application_Model_BootMenuEntries $botmenuentries) { if (null === ($id = $botmenuentries->getID()) ) { @@ -105,6 +113,7 @@ class Application_Model_BootMenuEntriesMapper $row = $result->current(); $botmenuentries->setID($row->bootmenuentriesID)->setBootosID($row->bootosID)->setBootmenuID($row->bootmenuID)->setTitle($row->title)->setConfigID($row->configID)->setKcl($row->kcl)->setOrder($row->order); + } public function fetchAll() diff --git a/application/models/BootOsMapper.php b/application/models/BootOsMapper.php index 2f43916..a6e9a7f 100644 --- a/application/models/BootOsMapper.php +++ b/application/models/BootOsMapper.php @@ -64,8 +64,9 @@ class Application_Model_BootOsMapper } } - public function find($id, Application_Model_BootOs $botos) + public function find($id) { + $botos = new Application_Model_BootOs(); $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; @@ -74,6 +75,7 @@ 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; } public function fetchAll() |
