|
@@ 336-341 (lines=6) @@
|
| 333 |
|
$sql .= NodeFactory::toSql($this->columns, $dbConnection, $parameters, ',', false, $indent + 2, $conditionsMode); |
| 334 |
|
} |
| 335 |
|
|
| 336 |
|
if (!empty($this->from)) { |
| 337 |
|
$from = NodeFactory::toSql($this->from, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode); |
| 338 |
|
if ($from) { |
| 339 |
|
$sql .= "\nFROM ".$from; |
| 340 |
|
} |
| 341 |
|
} |
| 342 |
|
|
| 343 |
|
if (!empty($this->where)) { |
| 344 |
|
$where = NodeFactory::toSql($this->where, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode); |
|
@@ 343-348 (lines=6) @@
|
| 340 |
|
} |
| 341 |
|
} |
| 342 |
|
|
| 343 |
|
if (!empty($this->where)) { |
| 344 |
|
$where = NodeFactory::toSql($this->where, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode); |
| 345 |
|
if ($where) { |
| 346 |
|
$sql .= "\nWHERE ".$where; |
| 347 |
|
} |
| 348 |
|
} |
| 349 |
|
|
| 350 |
|
if (!empty($this->group)) { |
| 351 |
|
$groupBy = NodeFactory::toSql($this->group, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode); |
|
@@ 350-355 (lines=6) @@
|
| 347 |
|
} |
| 348 |
|
} |
| 349 |
|
|
| 350 |
|
if (!empty($this->group)) { |
| 351 |
|
$groupBy = NodeFactory::toSql($this->group, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode); |
| 352 |
|
if ($groupBy) { |
| 353 |
|
$sql .= "\nGROUP BY ".$groupBy; |
| 354 |
|
} |
| 355 |
|
} |
| 356 |
|
|
| 357 |
|
if (!empty($this->having)) { |
| 358 |
|
$having = NodeFactory::toSql($this->having, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode); |
|
@@ 357-362 (lines=6) @@
|
| 354 |
|
} |
| 355 |
|
} |
| 356 |
|
|
| 357 |
|
if (!empty($this->having)) { |
| 358 |
|
$having = NodeFactory::toSql($this->having, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode); |
| 359 |
|
if ($having) { |
| 360 |
|
$sql .= "\nHAVING ".$having; |
| 361 |
|
} |
| 362 |
|
} |
| 363 |
|
|
| 364 |
|
if (!empty($this->order)) { |
| 365 |
|
$order = NodeFactory::toSql($this->order, $dbConnection, $parameters, ',', false, $indent + 2, $conditionsMode); |
|
@@ 364-369 (lines=6) @@
|
| 361 |
|
} |
| 362 |
|
} |
| 363 |
|
|
| 364 |
|
if (!empty($this->order)) { |
| 365 |
|
$order = NodeFactory::toSql($this->order, $dbConnection, $parameters, ',', false, $indent + 2, $conditionsMode); |
| 366 |
|
if ($order) { |
| 367 |
|
$sql .= "\nORDER BY ".$order; |
| 368 |
|
} |
| 369 |
|
} |
| 370 |
|
|
| 371 |
|
if (!empty($this->offset) && empty($this->limit)) { |
| 372 |
|
throw new \Exception('There is no offset if no limit is provided. An error may have occurred during SQLParsing.'); |