From 5a976de3f4338191e25204f3e74fed87532637f4 Mon Sep 17 00:00:00 2001 From: zYne Date: Tue, 14 Aug 2007 20:23:02 +0000 Subject: [PATCH] fixes #335 --- lib/Doctrine/Query/Abstract.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/Query/Abstract.php b/lib/Doctrine/Query/Abstract.php index 1e06ae534..72bc33b3e 100644 --- a/lib/Doctrine/Query/Abstract.php +++ b/lib/Doctrine/Query/Abstract.php @@ -211,14 +211,20 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate */ public function set($key, $value, $params = null) { - if ($params !== null) { - if (is_array($params)) { - $this->_params = array_merge($this->_params, $params); - } else { - $this->_params[] = $params; + if (is_array($key)) { + foreach ($key as $k => $v) { + $this->set($k, '?', array($v)); } + } else { + if ($params !== null) { + if (is_array($params)) { + $this->_params = array_merge($this->_params, $params); + } else { + $this->_params[] = $params; + } + } + return $this->parseQueryPart('set', $key . ' = ' . $value, true); } - return $this->parseQueryPart('set', $key . ' = ' . $value, true); } /** * from