1
0
mirror of synced 2025-01-29 19:41:45 +03:00
This commit is contained in:
zYne 2007-07-31 20:22:10 +00:00
parent 9e90fee1ed
commit a57226b086

View File

@ -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;
} }
} }