Skip to content

Commit

Permalink
Merge pull request #86 from prasad83/master
Browse files Browse the repository at this point in the history
Accept Column object through setColumns.
  • Loading branch information
nilportugues authored Jun 21, 2017
2 parents 877d54f + 13fd053 commit a5f6c98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Syntax/SyntaxFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public static function createColumns(array &$arguments, $table = null)
$column->setAlias($index);
}

$createdColumns[] = $column;
} else if ($column instanceof Column) {
$createdColumns[] = $column;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/Syntax/Where.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ protected function compare($column, $value, $operator)
protected function prepareColumn($column)
{
//This condition handles the "Select as a a column" special case.
if ($column instanceof Select) {
//or when compare column is customized.
if ($column instanceof Select || $column instanceof Column) {
return $column;
}

Expand Down

0 comments on commit a5f6c98

Please sign in to comment.