summaryrefslogtreecommitdiffstats
path: root/application/models
diff options
context:
space:
mode:
authormichael pereira2011-03-16 16:35:20 +0100
committermichael pereira2011-03-16 16:35:20 +0100
commitb09352fc9ec322ea0ae744077a66fcaf61465ed5 (patch)
treeb9e45999ce4d1eaa08035601bfd8f14f91547d30 /application/models
parentKCLAppend hinzugefuegt, KCL fertig :-) (diff)
parentClientController geändert, Forms können in FBGui und User nicht benutzt werden (diff)
downloadpbs2-b09352fc9ec322ea0ae744077a66fcaf61465ed5.tar.gz
pbs2-b09352fc9ec322ea0ae744077a66fcaf61465ed5.tar.xz
pbs2-b09352fc9ec322ea0ae744077a66fcaf61465ed5.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/models')
-rw-r--r--application/models/Client.php10
-rw-r--r--application/models/ClientMapper.php10
-rw-r--r--application/models/SessionMapper.php5
3 files changed, 19 insertions, 6 deletions
diff --git a/application/models/Client.php b/application/models/Client.php
index a27c3b3..3c2b050 100644
--- a/application/models/Client.php
+++ b/application/models/Client.php
@@ -3,6 +3,7 @@
class Application_Model_Client
{
protected $_clientID;
+ protected $_groupID;
protected $_macadress;
protected $_hardwarehash;
@@ -53,6 +54,15 @@ class Application_Model_Client
$this->_clientID = $_clientID;
return $this;
}
+ public function getGroupID()
+ {
+ return $this->_groupID;
+ }
+ public function setGroupID($_groupID)
+ {
+ $this->_groupID = $_groupID;
+ return $this;
+ }
public function getMacadress()
{
return $this->_macadress;
diff --git a/application/models/ClientMapper.php b/application/models/ClientMapper.php
index 7016ae7..2c530d9 100644
--- a/application/models/ClientMapper.php
+++ b/application/models/ClientMapper.php
@@ -47,7 +47,11 @@ class Application_Model_ClientMapper
public function save(Application_Model_Client $client)
{
- $data = array('clientID'=> $client->getID() ,'macadress'=> $client->getMacadress() ,'hardwarehash'=> $client->getHardwarehash() );
+ $data = array('clientID'=> $client->getID() ,
+ 'groupID' => $client->getGroupID(),
+ 'macadress'=> $client->getMacadress() ,
+ 'hardwarehash'=> $client->getHardwarehash()
+ );
if (null === ($id = $client->getID()) ) {
unset($data['clientID']);
@@ -75,7 +79,7 @@ class Application_Model_ClientMapper
$row = $result->current();
- $client->setID($row->clientID)->setMacadress($row->macadress)->setHardwarehash($row->hardwarehash);
+ $client->setID($row->clientID)->setGroupID($row->groupID)->setMacadress($row->macadress)->setHardwarehash($row->hardwarehash);
}
public function fetchAll()
@@ -85,7 +89,7 @@ class Application_Model_ClientMapper
foreach ($resultSet as $row) {
$entry = new Application_Model_Client();
- $entry->setID($row->clientID)->setMacadress($row->macadress)->setHardwarehash($row->hardwarehash);
+ $entry->setID($row->clientID)->setGroupID($row->groupID)->setMacadress($row->macadress)->setHardwarehash($row->hardwarehash);
$entries[] = $entry;
}
diff --git a/application/models/SessionMapper.php b/application/models/SessionMapper.php
index 83f0687..0810566 100644
--- a/application/models/SessionMapper.php
+++ b/application/models/SessionMapper.php
@@ -45,8 +45,7 @@ class Application_Model_SessionMapper
}
public function save(Application_Model_Session $session)
- {
-
+ {
$data = array( 'sessionID'=> $session->getID() ,
'alphasessionID'=> $session->getAlphasessionID(),
'clientID'=> $session->getClientID() ,
@@ -59,7 +58,7 @@ class Application_Model_SessionMapper
'ip6'=> $session->getIp6() );
if (null === ($id = $session->getID()) ) {
unset($data['sessionID']);
- $this->getDbTable()->insert($data);
+ return $this->getDbTable()->insert($data);
} else {
$this->getDbTable()->update($data, array('sessionID = ?' => $id));
}