Skip to content

Commit 22debcf

Browse files
committed
Update corresponding build method
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
1 parent d5cf665 commit 22debcf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/Components/JoinKeyword.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ public static function build($component, array $options = array())
179179
{
180180
$ret = array();
181181
foreach ($component as $c) {
182-
$ret[] = array_search($c->type, static::$JOINS) . ' '
183-
. $c->expr . ' ON ' . Condition::build($c->on);
182+
$ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr
183+
. (! empty($c->on)
184+
? ' ON ' . Condition::build($c->on)
185+
: ' USING ' . ArrayObj::build($c->using));
184186
}
185187
return implode(' ', $ret);
186188
}

0 commit comments

Comments
 (0)