Conditions | 3 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | private function _sanitizeVersionsInTable($table) |
||
33 | { |
||
34 | $sql = 'SELECT `id`, `pma_version` FROM `' . $table . '`'; |
||
35 | $count = 0; |
||
36 | $incidentsTable = TableRegistry::get('Incidents'); |
||
37 | $result = $this->query($sql); |
||
38 | |||
39 | while ($row = $result->fetch()) { |
||
40 | $strippedVersionString |
||
41 | = $incidentsTable->getStrippedPmaVersion( |
||
42 | $row['pma_version'] |
||
43 | ); |
||
44 | |||
45 | if ($strippedVersionString !== $row['pma_version']) { |
||
46 | $this->execute('UPDATE ' . $table . ' SET `pma_version` = \'' |
||
47 | . $strippedVersionString . '\' WHERE `id` = \'' |
||
48 | . $row['id'] . '\'' |
||
49 | ); |
||
50 | |||
51 | ++$count; |
||
52 | } |
||
53 | } |
||
54 | |||
55 | return $count; |
||
56 | } |
||
57 | } |
||
58 |