aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models/HardwareModel.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-07-15 15:23:51 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-07-15 15:23:51 +0000
commitff7042aba4ba6a98b98b7a4435417d63374f2d69 (patch)
tree8949f0b7bbb36ef70492694371f4977321a4e2ba /h-source/Application/Models/HardwareModel.php
parent8e1a6083cf4be6b0fb2d31863e409dfcb4705261 (diff)
added view file for permanently deleted devices
Diffstat (limited to 'h-source/Application/Models/HardwareModel.php')
-rw-r--r--h-source/Application/Models/HardwareModel.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/h-source/Application/Models/HardwareModel.php b/h-source/Application/Models/HardwareModel.php
index a1aa01b..1c552c0 100644
--- a/h-source/Application/Models/HardwareModel.php
+++ b/h-source/Application/Models/HardwareModel.php
@@ -72,9 +72,13 @@ class HardwareModel extends Model_Map {
parent::__construct();
}
- public function oupdate($id)
+ public function permanentlyDelete($id)
{
- return $this->pUpdate($id);
+ $this->values['deleted'] = 'no';
+ $this->values['approved'] = 'yes';
+ $this->values['pci_id'] = '';
+
+ return parent::update($id);
}
public function pUpdate($id)
@@ -284,5 +288,16 @@ class HardwareModel extends Model_Map {
}
return false;
}
+
+ public function isCleared($id)
+ {
+ $clean['id'] = (int)$id;
+ $res = $this->select('hardware.cleared')->where(array('id_hard'=>$clean['id']))->send();
+ if ( count($res) > 0 )
+ {
+ return strcmp($res[0]['hardware']['cleared'],'no') === 0 ? false : true;
+ }
+ return false;
+ }
} \ No newline at end of file