Subversion Repositories ALCASAR

Rev

Rev 2976 | Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
2788 rexy 1
<?php
2
/**
3
 * HWDevice TO class
4
 *
5
 * PHP version 5
6
 *
7
 * @category  PHP
8
 * @package   PSI_TO
9
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
10
 * @copyright 2009 phpSysInfo
11
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
12
 * @version   SVN: $Id: class.HWDevice.inc.php 255 2009-06-17 13:39:41Z bigmichi1 $
13
 * @link      http://phpsysinfo.sourceforge.net
14
 */
15
 /**
16
 * HWDevice TO class
17
 *
18
 * @category  PHP
19
 * @package   PSI_TO
20
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
21
 * @copyright 2009 phpSysInfo
22
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
23
 * @version   Release: 3.0
24
 * @link      http://phpsysinfo.sourceforge.net
25
 */
26
class HWDevice
27
{
28
    /**
29
     * name of the device
30
     *
31
     * @var String
32
     */
33
    private $_name = "";
34
 
35
    /**
36
     * capacity of the device, if not available it will be null
37
     *
38
     * @var Integer
39
     */
40
    private $_capacity = null;
41
 
42
    /**
43
     * manufacturer of the device, if not available it will be null
44
     *
45
     * @var Integer
46
     */
47
    private $_manufacturer = null;
48
 
49
    /**
50
     * product of the device, if not available it will be null
51
     *
52
     * @var Integer
53
     */
54
    private $_product = null;
55
 
56
    /**
57
     * serial number of the device, if not available it will be null
58
     *
59
     * @var Integer
60
     */
61
    private $_serial = null;
62
 
63
    /**
64
     * count of the device
65
     *
66
     * @var Integer
67
     */
68
    private $_count = 1;
69
 
70
    /**
71
     * compare a given device with the internal one
72
     *
73
     * @param HWDevice $dev device that should be compared
74
     *
75
     * @return boolean
76
     */
77
    public function equals(HWDevice $dev)
78
    {
79
        if ($dev->getName() === $this->_name
80
           && $dev->getCapacity() === $this->_capacity
81
           && $dev->getManufacturer() === $this->_manufacturer
82
           && $dev->getProduct() === $this->_product
83
           && $dev->getSerial() === $this->_serial) {
84
            return true;
85
        } else {
86
            return false;
87
        }
88
    }
89
 
90
    /**
91
     * Returns $_name.
92
     *
93
     * @see HWDevice::$_name
94
     *
95
     * @return String
96
     */
97
    public function getName()
98
    {
99
        return $this->_name;
100
    }
101
 
102
    /**
103
     * Sets $_name.
104
     *
105
     * @param String $name device name
106
     *
107
     * @see HWDevice::$_name
108
     *
109
     * @return Void
110
     */
111
    public function setName($name)
112
    {
113
        $this->_name = $name;
114
    }
115
 
116
    /**
117
     * Returns $_manufacturer.
118
     *
119
     * @see HWDevice::$_manufacturer
120
     *
121
     * @return String
122
     */
123
    public function getManufacturer()
124
    {
125
        return $this->_manufacturer;
126
    }
127
 
128
    /**
129
     * Sets $_manufacturer.
130
     *
131
     * @param String $manufacturer manufacturer name
132
     *
133
     * @see HWDevice::$_manufacturer
134
     *
135
     * @return Void
136
     */
137
    public function setManufacturer($manufacturer)
138
    {
139
        $this->_manufacturer = $manufacturer;
140
    }
141
 
142
    /**
143
     * Returns $_product.
144
     *
145
     * @see HWDevice::$_product
146
     *
147
     * @return String
148
     */
149
    public function getProduct()
150
    {
151
        return $this->_product;
152
    }
153
 
154
    /**
155
     * Sets $_product.
156
     *
157
     * @param String $product product name
158
     *
159
     * @see HWDevice::$_product
160
     *
161
     * @return Void
162
     */
163
    public function setProduct($product)
164
    {
165
        $this->_product = $product;
166
    }
167
 
168
    /**
169
     * Returns $_serial.
170
     *
171
     * @see HWDevice::$_serial
172
     *
173
     * @return String
174
     */
175
    public function getSerial()
176
    {
177
        return $this->_serial;
178
    }
179
 
180
    /**
181
     * Sets $_serial.
182
     *
183
     * @param String $serial serial number
184
     *
185
     * @see HWDevice::$_serial
186
     *
187
     * @return Void
188
     */
189
    public function setSerial($serial)
190
    {
191
        $this->_serial = $serial;
192
    }
193
 
194
    /**
195
     * Returns $_capacity.
196
     *
197
     * @see HWDevice::$_capacity
198
     *
199
     * @return Integer
200
     */
201
    public function getCapacity()
202
    {
203
        return $this->_capacity;
204
    }
205
 
206
    /**
207
     * Sets $_capacity.
208
     *
209
     * @param Integer $capacity device capacity
210
     *
211
     * @see HWDevice::$_capacity
212
     *
213
     * @return Void
214
     */
215
    public function setCapacity($capacity)
216
    {
217
        $this->_capacity = $capacity;
218
    }
219
 
220
    /**
221
     * Returns $_count.
222
     *
223
     * @see HWDevice::$_count
224
     *
225
     * @return Integer
226
     */
227
    public function getCount()
228
    {
229
        return $this->_count;
230
    }
231
 
232
    /**
233
     * Sets $_count.
234
     *
235
     * @param Integer $count device count
236
     *
237
     * @see HWDevice::$_count
238
     *
239
     * @return Void
240
     */
241
    public function setCount($count)
242
    {
243
        $this->_count = $count;
244
    }
245
}