| Conditions | 4 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function __construct(string $table, string $column = '*', bool $distinct = false, $condition = null) { |
||
| 21 | |||
| 22 | # Process arguments |
||
| 23 | |||
| 24 | $table = $this->getName($table); |
||
| 25 | |||
| 26 | if ($column !== '*') $column = (($distinct ? 'DISTINCT ' : '') . $this->getName($column)); |
||
| 27 | |||
| 28 | $condition = $this->getString($condition, '^name IN $list', ' AND '); |
||
| 29 | |||
| 30 | # Build query |
||
| 31 | |||
| 32 | $this->query = ('SELECT COUNT(' . $column . ') as count ' . |
||
| 33 | |||
| 34 | 'FROM ' . $table . ($condition ? (' WHERE (' . $condition . ')') : '')); |
||
| 35 | } |
||
| 36 | } |
||
| 38 |