summaryrefslogtreecommitdiffstats
path: root/application/models/ClientMapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/models/ClientMapper.php')
-rw-r--r--application/models/ClientMapper.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/application/models/ClientMapper.php b/application/models/ClientMapper.php
index dda9f12..bf513ea 100644
--- a/application/models/ClientMapper.php
+++ b/application/models/ClientMapper.php
@@ -35,10 +35,19 @@ class Application_Model_ClientMapper
$data = array('clientID'=> $client->getID() ,'macadress'=> $client->getMacadress() ,'hardwarehash'=> $client->getHardwarehash() );
if (null === ($id = $client->getID()) ) {
- unset($data['id']);
+ unset($data['clientID']);
$this->getDbTable()->insert($data);
} else {
- $this->getDbTable()->update($data, array('id = ?' => $id));
+ $this->getDbTable()->update($data, array('clientID = ?' => $id));
+ }
+ }
+
+ public function delete(Application_Model_Client $client)
+ {
+ if (null === ($id = $client->getID()) ) {
+ return;
+ } else {
+ $this->getDbTable()->delete(array('clientID = ?' => $id));
}
}