Fix that the TreeToSqlParser cannot handle partial conjunction nodes
This commit is contained in:
parent
e355415164
commit
1604f4728b
|
@ -112,15 +112,14 @@ class TreeToSqlParser
|
|||
private function parseConjunctionNode(Node $node)
|
||||
{
|
||||
$queryString = '';
|
||||
$leftQuery = $this->nodeToSqlQuery($node->left);
|
||||
$rightQuery = $this->nodeToSqlQuery($node->right);
|
||||
$leftQuery = $node->left !== null ? $this->nodeToSqlQuery($node->left) : '';
|
||||
$rightQuery = $node->right !== null ? $this->nodeToSqlQuery($node->right) : '';
|
||||
|
||||
if ($leftQuery != '') {
|
||||
$queryString .= $leftQuery . ' ';
|
||||
}
|
||||
|
||||
if ($rightQuery != '') {
|
||||
|
||||
$queryString .= (($queryString !== '') ? $node->type . ' ' : ' ') . $rightQuery;
|
||||
}
|
||||
return $queryString;
|
||||
|
|
Loading…
Reference in New Issue