diff --git a/src/Syntax/SyntaxFactory.php b/src/Syntax/SyntaxFactory.php index 80294e3..821ae87 100644 --- a/src/Syntax/SyntaxFactory.php +++ b/src/Syntax/SyntaxFactory.php @@ -35,6 +35,8 @@ public static function createColumns(array &$arguments, $table = null) $column->setAlias($index); } + $createdColumns[] = $column; + } else if ($column instanceof Column) { $createdColumns[] = $column; } } diff --git a/src/Syntax/Where.php b/src/Syntax/Where.php index 0897dbe..7e9b883 100644 --- a/src/Syntax/Where.php +++ b/src/Syntax/Where.php @@ -267,7 +267,8 @@ public function compare($column, $value, $operator) private 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; }