diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-10-03 07:53:59 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-10-03 07:53:59 +0000 |
commit | fab22f5ebb7c5f757e48292a7f8de605638b7213 (patch) | |
tree | bb33937250d0b36117a65047a4bad32f6279a52f /h-source/Application/Models/HardwareModel.php | |
parent | f4420f9dea80c5be0bb7d41a20e2db0dcce715a5 (diff) |
when a device is already in the database (same vendorid_productid code) the system puts the link to the device - sudoman issue
Diffstat (limited to 'h-source/Application/Models/HardwareModel.php')
-rw-r--r-- | h-source/Application/Models/HardwareModel.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/h-source/Application/Models/HardwareModel.php b/h-source/Application/Models/HardwareModel.php index d5aaffb..9a40e4b 100644 --- a/h-source/Application/Models/HardwareModel.php +++ b/h-source/Application/Models/HardwareModel.php @@ -282,6 +282,18 @@ class HardwareModel extends Model_Map { return $name; } + //get the model info by the vendorid:productid code + public function getModelByCode($code) + { + $res = $this->clear()->where(array('pci_id'=>sanitizePciid($code)))->send(); + + if (count($res) > 0) + { + return $res[0]['hardware']; + } + return false; + } + //save in the history all the action carried out by users protected function updateHistory($action) { |