Conditions | 7 |
Paths | 64 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
52 | public function __toString(): string |
||
53 | { |
||
54 | $expression = ($this->calcFoundRows ? 'SQL_CALC_FOUND_ROWS ' : '') . $this->expression; |
||
55 | |||
56 | if (isset($this->tableAlias)) { |
||
57 | $from = sprintf('`%s` AS `%s`', $this->table, $this->tableAlias); |
||
58 | } else { |
||
59 | $from = sprintf('`%s`', $this->table); |
||
60 | } |
||
61 | |||
62 | $limit = isset($this->limit) ? ' LIMIT '.$this->limit : ''; |
||
63 | $where = isset($this->where) ? ' WHERE ('.$this->where.')' : ''; |
||
64 | $having = isset($this->having) ? ' HAVING ('.$this->having.')' : ''; |
||
65 | $order = isset($this->order) ? ' ORDER BY '.$this->order : ''; |
||
66 | |||
67 | return sprintf('SELECT %s FROM %s %s %s %s %s', $expression, $from, $where, $having, $order, $limit); |
||
68 | } |
||
70 |