fixes #338
This commit is contained in:
parent
9e90fee1ed
commit
a57226b086
@ -34,24 +34,23 @@ class Doctrine_Query_Set extends Doctrine_Query_Part
|
|||||||
{
|
{
|
||||||
public function parse($dql)
|
public function parse($dql)
|
||||||
{
|
{
|
||||||
$parts = Doctrine_Tokenizer::sqlExplode($dql, ',');
|
preg_match_all("/[a-z0-9_]+\.[a-z0-9_]+[\.[a-z0-9]+]*/i", $dql, $m);
|
||||||
|
|
||||||
$result = array();
|
if (isset($m[0])) {
|
||||||
foreach ($parts as $part) {
|
foreach ($m[0] as $part) {
|
||||||
$set = Doctrine_Tokenizer::sqlExplode($part, '=');
|
$e = explode('.', trim($part));
|
||||||
|
$field = array_pop($e);
|
||||||
$e = explode('.', trim($set[0]));
|
|
||||||
$field = array_pop($e);
|
$reference = implode('.', $e);
|
||||||
|
|
||||||
$reference = implode('.', $e);
|
$alias = $this->query->getTableAlias($reference);
|
||||||
|
$map = $this->query->getAliasDeclaration($reference);
|
||||||
$alias = $this->query->getTableAlias($reference);
|
|
||||||
$map = $this->query->getAliasDeclaration($reference);
|
$dql = str_replace($part, $map['table']->getColumnName($field), $dql);
|
||||||
|
}
|
||||||
$result[] = $map['table']->getColumnName($field) . ' = ' . $set[1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode(', ', $result);
|
return $dql;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user