Skip to content

Commit 47fdcea

Browse files
committed
fixed property name quoting
1 parent 5025b9c commit 47fdcea

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/PHPCR/Util/QOM/Sql2Generator.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function evalJoinType($joinType)
9191
*/
9292
public function evalEquiJoinCondition($sel1Name, $prop1Name, $sel2Name, $prop2Name)
9393
{
94-
return $this->qualifyProperty($sel1Name, $prop1Name) . '=' .$this->qualifyProperty($sel2Name, $prop2Name);
94+
return $this->evalPropertyValue($prop1Name, $sel1Name) . '=' .$this->evalPropertyValue($prop2Name, $sel2Name);
9595
}
9696

9797
/**
@@ -194,7 +194,7 @@ public function evalDescendantNode($path, $selectorName = null)
194194

195195
public function evalPropertyExistence($selectorName, $propertyName)
196196
{
197-
return $this->qualifyProperty($selectorName, $propertyName) . " IS NOT NULL";
197+
return $this->evalPropertyValue($propertyName, $selectorName) . " IS NOT NULL";
198198
}
199199

200200
/**
@@ -213,7 +213,7 @@ public function evalFullTextSearch($selectorName, $searchExpression, $propertyNa
213213
$propertyName = $propertyName ?: '*';
214214

215215
$sql2 = 'CONTAINS(';
216-
$sql2 .= $this->qualifyProperty($selectorName, $propertyName);
216+
$sql2 .= $this->evalPropertyValue($propertyName, $selectorName);
217217
$sql2 .= ', ' . $searchExpression . ')';
218218

219219
return $sql2;
@@ -304,7 +304,7 @@ public function evalColumn($selectorName, $propertyName = null, $colname = null)
304304
if (! is_null($selectorName) && is_null($propertyName) && is_null($colname)) {
305305
$sql2 .= $selectorName . '.*';
306306
} else {
307-
$sql2 .= $this->qualifyProperty($selectorName, $propertyName);
307+
$sql2 .= $this->evalPropertyValue($propertyName, $selectorName);
308308
$sql2 .= ! is_null($colname) ? ' AS ' . $colname : '';
309309
}
310310

@@ -344,9 +344,4 @@ public function evalCastLiteral($literal, $type)
344344
{
345345
return "CAST('$literal' AS $type)";
346346
}
347-
348-
private function qualifyProperty($selectorName, $propertyName)
349-
{
350-
return $selectorName ? $selectorName.'.'.$propertyName : $propertyName;
351-
}
352347
}

0 commit comments

Comments
 (0)