diff options
Diffstat (limited to 'application/models/BootMenuEntriesMapper.php')
| -rw-r--r-- | application/models/BootMenuEntriesMapper.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/application/models/BootMenuEntriesMapper.php b/application/models/BootMenuEntriesMapper.php index 346664c..a837dca 100644 --- a/application/models/BootMenuEntriesMapper.php +++ b/application/models/BootMenuEntriesMapper.php @@ -11,7 +11,8 @@ class Application_Model_BootMenuEntriesMapper $db = Zend_Db_Table::getDefaultAdapter(); $select = $this->getDbTable()->select() ->from($this->_dbTable) - ->where($criteria . ' = ?', $value); + ->where($criteria . ' = ?', $value) + ->order('order'); $stmt = $select->query(); $resultSet = $stmt->fetchAll(); @@ -67,6 +68,24 @@ class Application_Model_BootMenuEntriesMapper } } + public function order(Application_Model_BootMenuEntries $botmenuentries) + { + $db = Zend_Db_Table::getDefaultAdapter(); + $stmt = $db->query("UPDATE pbs_bootmenuentries SET `order` = `order` + 1 WHERE `order` >= ". $botmenuentries->getOrder() . " AND `bootmenuID` = " . $botmenuentries->getBootmenuID()); + } + + public function orderremove(Application_Model_BootMenuEntries $botmenuentries) + { + $db = Zend_Db_Table::getDefaultAdapter(); + $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) + { + $db = Zend_Db_Table::getDefaultAdapter(); + $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()) ) { |
