| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 12 | public static function get_enumset_values(\DB\pdo $pdo, string $table, string $field) |
||
| 13 | { |
||
| 14 | $type = $pdo->query("SHOW COLUMNS FROM {$table} WHERE Field = '{$field}'")->row_array()['Type']; |
||
| 15 | if (preg_match("/^enum\(\'(.*)\'\)$/", $type, $matches)) { |
||
| 16 | $enum = explode("','", $matches[1]); |
||
| 17 | |||
| 18 | return $enum; |
||
| 19 | } elseif (preg_match("/^set\(\'(.*)\'\)$/", $type, $matches)) { |
||
| 20 | $set = explode("','", $matches[1]); |
||
| 21 | |||
| 22 | return $set; |
||
| 23 | } |
||
| 24 | |||
| 25 | return []; |
||
| 26 | } |
||
| 28 |