| @@ 114-124 (lines=11) @@ | ||
| 111 | } |
|
| 112 | ||
| 113 | // WHERE |
|
| 114 | if (!empty($this->where)) { |
|
| 115 | $first = true; |
|
| 116 | $sql .= ' WHERE'; |
|
| 117 | foreach ($this->where as $where) { |
|
| 118 | if ($first === false) { |
|
| 119 | $sql .= ' '.$where['operator']; |
|
| 120 | } |
|
| 121 | $sql .= ' '.$where['sql']; |
|
| 122 | $first = false; |
|
| 123 | } |
|
| 124 | } |
|
| 125 | ||
| 126 | // GROUP BY |
|
| 127 | if (!empty($this->groupBy)) { |
|
| @@ 133-143 (lines=11) @@ | ||
| 130 | } |
|
| 131 | ||
| 132 | // HAVING |
|
| 133 | if (!empty($this->having)) { |
|
| 134 | $first = true; |
|
| 135 | $sql .= ' HAVING'; |
|
| 136 | foreach ($this->having as $having) { |
|
| 137 | if ($first === false) { |
|
| 138 | $sql .= ' '.$having['operator']; |
|
| 139 | } |
|
| 140 | $sql .= ' '.$having['sql']; |
|
| 141 | $first = false; |
|
| 142 | } |
|
| 143 | } |
|
| 144 | ||
| 145 | // ORDER BY |
|
| 146 | if (!empty($this->orderBy)) { |
|