| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function check() |
||
| 37 | { |
||
| 38 | if (!DB::get_schema()->hasTable($this->checkTable)) { |
||
| 39 | return [EnvironmentCheck::ERROR, "$this->checkTable not present in the database"]; |
||
| 40 | } |
||
| 41 | |||
| 42 | $count = DB::query("SELECT COUNT(*) FROM \"$this->checkTable\"")->value(); |
||
| 43 | |||
| 44 | if ($count > 0) { |
||
| 45 | return [EnvironmentCheck::OK, '']; |
||
| 46 | } |
||
| 47 | |||
| 48 | return [EnvironmentCheck::WARNING, "$this->checkTable queried ok but has no records"]; |
||
| 49 | } |
||
| 51 |