diff options
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); } |