From 22debcf27a870b946daf57565af32cf4aa73f5d9 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Fri, 19 Feb 2016 06:22:44 +1100 Subject: [PATCH] Update corresponding build method Signed-off-by: Madhura Jayaratne --- src/Components/JoinKeyword.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Components/JoinKeyword.php b/src/Components/JoinKeyword.php index 9ec681b1b..7546b5676 100644 --- a/src/Components/JoinKeyword.php +++ b/src/Components/JoinKeyword.php @@ -179,8 +179,10 @@ public static function build($component, array $options = array()) { $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); }