. */ Doctrine::autoload('Doctrine_Query_Part'); /** * Doctrine_Query * * @package Doctrine * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.phpdoctrine.com * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen */ class Doctrine_Query_Set extends Doctrine_Query_Part { public function parse($dql) { $parts = Doctrine_Tokenizer::sqlExplode($dql, ','); $result = array(); foreach ($parts as $part) { $set = Doctrine_Tokenizer::sqlExplode($part, '='); $e = explode('.', trim($set[0])); $field = array_pop($e); $reference = implode('.', $e); $alias = $this->query->getTableAlias($reference); $map = $this->query->getDeclaration($reference); $result[] = $map['table']->getColumnName($field) . ' = ' . $set[1]; } $this->query->addQueryPart('set', implode(', ', $result)); return $this->query; } }