1
0
mirror of synced 2024-12-05 03:06:05 +03:00

[DDC-3436] Fix changes requested 2/2

This commit is contained in:
Kiel Goodman 2015-01-12 14:44:46 +00:00 committed by Marco Pivetta
parent dc98da585d
commit 0c5ea34fd4

View File

@ -135,21 +135,17 @@ class QueryExpressionVisitor extends ExpressionVisitor
if ( ! isset($this->queryAliases[0])) {
throw new QueryException('No aliases are set before invoking walkComparison().');
}
$field = $comparison->getField();
$hasValidAlias = false;
$field = $this->queryAliases[0] . '.' . $comparison->getField();
foreach($this->queryAliases as $alias) {
if(strpos($field . '.', $alias . '.') === 0) {
$hasValidAlias = true;
if(strpos($comparison->getField() . '.', $alias . '.') === 0) {
$field = $comparison->getField();
break;
}
}
$parameterName = str_replace('.', '_', $field);
if(!$hasValidAlias) {
$field = $this->queryAliases[0] . '.' . $field;
}
$parameterName = str_replace('.', '_', $comparison->getField());
foreach($this->parameters as $parameter) {
if($parameter->getName() === $parameterName) {