|
|
| $trusted_table = "cutrustedmaster" |
| |
|
| $trusted_default |
| |
Updates trusted master to include testers for DMI
Definition at line 13 of file 2019102100_updXDITrustedMaster.php.
◆ down()
| updXDITrustedMaster::down |
( |
| ) |
|
◆ up()
| updXDITrustedMaster::up |
( |
| ) |
|
See if row defined above exists in trusted master. If so, update it to force the content defined above
Since trustedid is unique key to table, counting on only one entry
- Returns
- void
Definition at line 74 of file 2019102100_updXDITrustedMaster.php.
76 if ($this->hasTable($this->trusted_table)) {
78 $def = $this->trusted_default;
79 $sql =
"select * from {$this->trusted_table} where trustedid = '{$def['trustedid']}'";
81 # note appears that fetchRow always returns count of 1, even if no row is found. 82 # using fetchAll even though I expect max 1 record (trustedid is unique key) 84 $trusted_row = $this->fetchAll($sql);
86 if (count($trusted_row) > 0) {
87 $sql =
"update {$this->trusted_table} set trustedfields = E'" 88 . json_encode($def[
'trustedfields'])
89 .
"' where trustedid = '{$def['trustedid']}'";
91 echo
" updating {$def['trustedid']} trusted master\n";
96 $sql =
"insert into {$this->trusted_table} (trustedid, trustedvendor, trustedtype, hcuinterface, trustedfields)" 97 .
" values('{$def['trustedid']}', '{$def['trustedvendor']}', '{$def['trustedtype']}'," 98 .
" E'{$def['hcuinterface']}', E'" . json_encode($def[
'trustedfields']) .
"')";
100 echo
" inserting {$def['trustedid']} trusted master\n";
The documentation for this class was generated from the following file: