| @@ 598-614 (lines=17) @@ | ||
| 595 | return $sql; |
|
| 596 | } |
|
| 597 | ||
| 598 | protected function processTableExpression($parsed, $index) |
|
| 599 | { |
|
| 600 | if ($parsed['expr_type'] !== ExpressionType::TABLE_EXPRESSION) { |
|
| 601 | return ''; |
|
| 602 | } |
|
| 603 | $sql = substr($this->processFROM($parsed['sub_tree']), 5); // remove FROM keyword |
|
| 604 | $sql = '('.$sql.')'; |
|
| 605 | $sql .= $this->processAlias($parsed['alias']); |
|
| 606 | ||
| 607 | if ($index !== 0) { |
|
| 608 | $sql = $this->processJoin($parsed['join_type']).' '.$sql; |
|
| 609 | $sql .= $this->processRefType($parsed['ref_type']); |
|
| 610 | $sql .= $this->processRefClause($parsed['ref_clause']); |
|
| 611 | } |
|
| 612 | ||
| 613 | return $sql; |
|
| 614 | } |
|
| 615 | ||
| 616 | protected function processSubQuery($parsed, $index = 0) |
|
| 617 | { |
|
| @@ 616-636 (lines=21) @@ | ||
| 613 | return $sql; |
|
| 614 | } |
|
| 615 | ||
| 616 | protected function processSubQuery($parsed, $index = 0) |
|
| 617 | { |
|
| 618 | if ($parsed['expr_type'] !== ExpressionType::SUBQUERY) { |
|
| 619 | return ''; |
|
| 620 | } |
|
| 621 | ||
| 622 | $sql = $this->processSelectStatement($parsed['sub_tree']); |
|
| 623 | $sql = '('.$sql.')'; |
|
| 624 | ||
| 625 | if (isset($parsed['alias'])) { |
|
| 626 | $sql .= $this->processAlias($parsed['alias']); |
|
| 627 | } |
|
| 628 | ||
| 629 | if ($index !== 0) { |
|
| 630 | $sql = $this->processJoin($parsed['join_type']).' '.$sql; |
|
| 631 | $sql .= $this->processRefType($parsed['ref_type']); |
|
| 632 | $sql .= $this->processRefClause($parsed['ref_clause']); |
|
| 633 | } |
|
| 634 | ||
| 635 | return $sql; |
|
| 636 | } |
|
| 637 | ||
| 638 | protected function processOperator($parsed) |
|
| 639 | { |
|