diff options
author | Madhura Jayaratne <madhura.cj@gmail.com> | 2016-02-19 06:22:44 +1100 |
---|---|---|
committer | Madhura Jayaratne <madhura.cj@gmail.com> | 2016-02-19 06:22:44 +1100 |
commit | 22debcf27a870b946daf57565af32cf4aa73f5d9 (patch) | |
tree | 92dcacc44474b10623622ed684c0ae98e5462fee /src | |
parent | d5cf6651e9021c248034099fb5d20f41a7ae2308 (diff) | |
download | sql-parser-22debcf27a870b946daf57565af32cf4aa73f5d9.zip sql-parser-22debcf27a870b946daf57565af32cf4aa73f5d9.tar.gz sql-parser-22debcf27a870b946daf57565af32cf4aa73f5d9.tar.bz2 |
Update corresponding build method
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/Components/JoinKeyword.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Components/JoinKeyword.php b/src/Components/JoinKeyword.php index 9ec681b..7546b56 100644 --- a/src/Components/JoinKeyword.php +++ b/src/Components/JoinKeyword.php @@ -179,8 +179,10 @@ class JoinKeyword extends Component { $ret = array(); foreach ($component as $c) { - $ret[] = array_search($c->type, static::$JOINS) . ' ' - . $c->expr . ' ON ' . Condition::build($c->on); + $ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr + . (! empty($c->on) + ? ' ON ' . Condition::build($c->on) + : ' USING ' . ArrayObj::build($c->using)); } return implode(' ', $ret); } |