summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon2011-03-07 13:58:52 +0100
committerSimon2011-03-07 13:58:52 +0100
commitb6ba854295aa777e7de70add9fb419ebc23b81c2 (patch)
tree63a71bf3d312c6b5c0c0589536a354b9b6c86c06
parentPool actions zum bearbeiten von Pools hinzugefügt (diff)
parentBootmenuentries DB geaendert (diff)
downloadpbs2-b6ba854295aa777e7de70add9fb419ebc23b81c2.tar.gz
pbs2-b6ba854295aa777e7de70add9fb419ebc23b81c2.tar.xz
pbs2-b6ba854295aa777e7de70add9fb419ebc23b81c2.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
-rw-r--r--application/models/BootMenuEntries.php10
-rw-r--r--application/models/BootMenuEntriesMapper.php12
-rw-r--r--pbs.sql2
3 files changed, 18 insertions, 6 deletions
diff --git a/application/models/BootMenuEntries.php b/application/models/BootMenuEntries.php
index d27fd20..ec42507 100644
--- a/application/models/BootMenuEntries.php
+++ b/application/models/BootMenuEntries.php
@@ -2,6 +2,7 @@
class Application_Model_BootMenuEntries
{
+ protected $_bootmenuentriesID;
protected $_bootosID;
protected $_bootmenuID;
protected $_title;
@@ -45,6 +46,15 @@ class Application_Model_BootMenuEntries
}
return $this;
}
+ public function getID()
+ {
+ return $this->_bootmenuentriesID;
+ }
+ public function setID($_bootmenuentriesID)
+ {
+ $this->_bootmenuentriesID = $_bootmenuentriesID;
+ return $this;
+ }
public function getBootosID()
{
return $this->_bootosID;
diff --git a/application/models/BootMenuEntriesMapper.php b/application/models/BootMenuEntriesMapper.php
index 2dac085..632d578 100644
--- a/application/models/BootMenuEntriesMapper.php
+++ b/application/models/BootMenuEntriesMapper.php
@@ -32,13 +32,13 @@ class Application_Model_BootMenuEntriesMapper
public function save(Application_Model_BootMenuEntries $botmenuentries)
{
- $data = array('bootosID'=> $botmenuentries->getBootosID() ,'bootmenuID'=> $botmenuentries->getBootmenuID() ,'configID'=> $botmenuentries->getConfigID() ,'title'=> $botmenuentries->getTitle() ,'kcl'=> $botmenuentries->getKcl() ,'order'=> $botmenuentries->getOrder() );
+ $data = array('bootmenuentriesID' => $botmenuentries->getID(), 'bootosID'=> $botmenuentries->getBootosID() ,'bootmenuID'=> $botmenuentries->getBootmenuID() ,'configID'=> $botmenuentries->getConfigID() ,'title'=> $botmenuentries->getTitle() ,'kcl'=> $botmenuentries->getKcl() ,'order'=> $botmenuentries->getOrder() );
- if (null === ($id1 = $botmenuentries->getID()) ) {
-
+ if (null === ($id = $botmenuentries->getID()) ) {
+ unset($data['bootmenuentriesID']);
$this->getDbTable()->insert($data);
} else {
- $this->getDbTable()->update($data, array('bootosID = ?' => $id1, 'bootmenuID = ?' => $id2));
+ $this->getDbTable()->update($data, array('bootosID = ?' => $id));
}
}
@@ -60,7 +60,7 @@ class Application_Model_BootMenuEntriesMapper
$row = $result->current();
- $botmenuentries->setBootosID($row->bootosID)->setBootmenuID($row->bootmenuID)->setTitle($row->title)->setConfigID($row->configID)->setKcl($row->kcl)->setOrder($row->order);
+ $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()
@@ -70,7 +70,7 @@ class Application_Model_BootMenuEntriesMapper
foreach ($resultSet as $row) {
$entry = new Application_Model_BootMenuEntries();
- $entry->setBootosID($row->bootosID)->setBootmenuID($row->bootmenuID)->setTitle($row->title)->setConfigID($row->configID)->setKcl($row->kcl)->setOrder($row->order);
+ $entry->setID($row->bootmenuentriesID)->setBootosID($row->bootosID)->setBootmenuID($row->bootmenuID)->setTitle($row->title)->setConfigID($row->configID)->setKcl($row->kcl)->setOrder($row->order);
$entries[] = $entry;
}
diff --git a/pbs.sql b/pbs.sql
index 7ec6eaa..aa8ba1c 100644
--- a/pbs.sql
+++ b/pbs.sql
@@ -158,12 +158,14 @@ ALTER TABLE `pbs_bootmenu`
ADD CONSTRAINT `pbs_bootmenu_ibfk_2` FOREIGN KEY (`groupID`) REFERENCES `pbs_group` (`groupID`) ON DELETE CASCADE;
CREATE TABLE IF NOT EXISTS `pbs_bootmenuentries` (
+ `bootmenuentriesID` int(11) NOT NULL AUTO_INCREMENT,
`bootosID` int(11) NOT NULL,
`bootmenuID` int(11) NOT NULL,
`title` varchar(30) NOT NULL,
`kcl` varchar(140),
`configID` int(11) NOT NULL,
`order` int(11) NOT NULL,
+ PRIMARY KEY (`bootmenuentriesID`),
KEY `bootosID` (`bootosID`),
KEY `bootmenuID` (`bootmenuID`),
KEY `configID` (`configID`)