LoadClassPropertyData.php
18.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
<?php
namespace Cacic\CommonBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Cacic\CommonBundle\Entity\ClassProperty;
use Cacic\CommonBundle\Entity\ClassPropertyType;
class LoadClassPropertyData extends AbstractFixture implements FixtureInterface, ContainerAwareInterface, OrderedFixtureInterface
{
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/*
* Carrega os atributos permitidos às classes WMI que serão utilizadas na coleta
*/
public function load(ObjectManager $manager)
{
/*************************
* Classe ComputerSystem
*************************/
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Short description of the object—a one-line string. This property is inherited from CIM_ManagedSystemElement.');
// Referência à classe
$property->setIdClass($this->getReference('ComputerSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Domain');
$property->setTePropertyDescription('Name of the domain to which a computer belongs.');
// Referência à classe
$property->setIdClass($this->getReference('ComputerSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('TotalPhysicalMemory');
$property->setTePropertyDescription('Total size of physical memory. Be aware that, under some circumstances, this property may not return an accurate value for the physical memory. For example, it is not accurate if the BIOS is using some of the physical memory. For an accurate value, use the Capacity property in Win32_PhysicalMemory instead.');
// Referência à classe
$property->setIdClass($this->getReference('ComputerSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('UserName');
$property->setTePropertyDescription('Name of a user that is logged on currently. This property must have a value. In a terminal services session, UserName returns the name of the user that is logged on to the console—not the user logged on during the terminal service session.');
// Referência à classe
$property->setIdClass($this->getReference('ComputerSystem'));
// Grava o objeto
$manager->persist($property);
// Grava todos os dados da classe
$manager->flush();
/*************************
* Classe Win32_NetworkAdapterConfiguration
*************************/
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('DefaultIPGateway');
$property->setTePropertyDescription('Array of IP addresses of default gateways that the computer system uses.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Description');
$property->setTePropertyDescription('Description of the CIM_Setting object. This property is inherited from CIM_Setting.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('DHCPServer');
$property->setTePropertyDescription('IP address of the dynamic host configuration protocol (DHCP) server.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('DNSDomain');
$property->setTePropertyDescription('Organization name followed by a period and an extension that indicates the type of organization, such as microsoft.com. The name can be any combination of the letters A through Z, the numerals 0 through 9, and the hyphen (-), plus the period (.) character used as a separator.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('DNSHostName');
$property->setTePropertyDescription('Host name used to identify the local computer for authentication by some utilities. Other TCP/IP-based utilities can use this value to acquire the name of the local computer. Host names are stored on DNS servers in a table that maps names to IP addresses for use by DNS. The name can be any combination of the letters A through Z, the numerals 0 through 9, and the hyphen (-), plus the period (.) character used as a separator. By default, this value is the Microsoft networking computer name, but the network administrator can assign another host name without affecting the computer name.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('DNSServerSearchOrder');
$property->setTePropertyDescription('Array of server IP addresses to be used in querying for DNS servers.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('IPAddress');
$property->setTePropertyDescription('Array of all of the IP addresses associated with the current network adapter. Starting with Windows Vista, this property can contain either IPv6 addresses or IPv4 addresses. For more information, see IPv6 and IPv4 Support in WMI.
Example IPv6 address: "2010:836B:4179::836B:4179"');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('IPSubnet');
$property->setTePropertyDescription('Array of all of the subnet masks associated with the current network adapter.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('MACAddress');
$property->setTePropertyDescription('Media Access Control (MAC) address of the network adapter. A MAC address is assigned by the manufacturer to uniquely identify the network adapter.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('WINSPrimaryServer');
$property->setTePropertyDescription('IP address for the primary WINS server.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('WINSSecondaryServer');
$property->setTePropertyDescription('IP address for the secondary WINS server.');
// Referência à classe
$property->setIdClass($this->getReference('Network'));
// Grava o objeto
$manager->persist($property);
// Grava todos os dados da classe
$manager->flush();
/*************************
* Classe Win32_OperatingSystem
*************************/
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Short description of the object—a one-line string. The string includes the operating system version. For example, "Microsoft Windows XP Professional Version = 5.1.2500". This property can be localized.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('CSDVersion');
$property->setTePropertyDescription('NULL-terminated string that indicates the latest service pack installed on a computer. If no service pack is installed, the string is NULL.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('InstallDate');
$property->setTePropertyDescription('Date object was installed. This property does not require a value to indicate that the object is installed.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('LastBootUpTime');
$property->setTePropertyDescription('Date and time the operating system was last restarted.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('NumberOfLicensedUsers');
$property->setTePropertyDescription('Number of user licenses for the operating system. If unlimited, enter 0 (zero). If unknown, enter -1.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('OSArchitecture');
$property->setTePropertyDescription('Architecture of the operating system, as opposed to the processor. This property can be localized.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('OSLanguage');
$property->setTePropertyDescription('Language version of the operating system installed.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('ProductType');
$property->setTePropertyDescription('Additional system information.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('SerialNumber');
$property->setTePropertyDescription('Operating system product serial identification number.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Version');
$property->setTePropertyDescription('Version number of the operating system.');
// Referência à classe
$property->setIdClass($this->getReference('OperatingSystem'));
// Grava o objeto
$manager->persist($property);
// Commit
$manager->flush();
/*************************
* Software List
*************************/
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('IDSoftware');
$property->setTePropertyDescription('Identificador do software no registro.');
// Referência à classe
$property->setIdClass($this->getReference('Software'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('DisplayName');
$property->setTePropertyDescription('Nome do software.');
// Referência à classe
$property->setIdClass($this->getReference('Software'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('DisplayVersion');
$property->setTePropertyDescription('Versão identificada.');
// Referência à classe
$property->setIdClass($this->getReference('Software'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('URLInfoAbout');
$property->setTePropertyDescription('URL do software.');
// Referência à classe
$property->setIdClass($this->getReference('Software'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Publisher');
$property->setTePropertyDescription('Nome do fabricante.');
// Referência à classe
$property->setIdClass($this->getReference('Software'));
// Grava o objeto
$manager->persist($property);
/*************************
* Hardware Classes
*
* A classe precisa ter pelo menos uma propriedade pré cadastrada
*
*************************/
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome do teclado');
// Referência à classe
$property->setIdClass($this->getReference('Keyboard'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome');
// Referência à classe
$property->setIdClass($this->getReference('PointingDevice'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome');
// Referência à classe
$property->setIdClass($this->getReference('PhysicalMedia'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome');
// Referência à classe
$property->setIdClass($this->getReference('BaseBoard'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome');
// Referência à classe
$property->setIdClass($this->getReference('BIOS'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome');
// Referência à classe
$property->setIdClass($this->getReference('MemoryDevice'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome');
// Referência à classe
$property->setIdClass($this->getReference('PhysicalMemory'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome');
// Referência à classe
$property->setIdClass($this->getReference('Processor'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome');
// Referência à classe
$property->setIdClass($this->getReference('Printer'));
// Grava o objeto
$manager->persist($property);
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('Caption');
$property->setTePropertyDescription('Nome');
// Referência à classe
$property->setIdClass($this->getReference('DesktopMonitor'));
// Grava o objeto
$manager->persist($property);
/*************************
* Patrimonio Classes
*
* A classe precisa ter pelo menos uma propriedade pré cadastrada
*
*************************/
// Atributo
$property = new ClassProperty();
$property->setNmPropertyName('IDPatrimonio');
$property->setTePropertyDescription('Número do patrimônio');
// Referência à classe
$property->setIdClass($this->getReference('Patrimonio'));
// Grava o objeto
$manager->persist($property);
// Commit
$manager->flush();
}
public function getOrder()
{
return 2;
}
}