1
0
mirror of synced 2024-12-13 14:56:01 +03:00

fix to whereIn to prevent invalid SQL being generated when no params are passed

This commit is contained in:
pookey 2008-01-26 21:20:24 +00:00
parent 7b453f1ab1
commit f7d691a0aa

View File

@ -1136,6 +1136,11 @@ abstract class Doctrine_Query_Abstract
public function whereIn($expr, $params = array(), $not = false) public function whereIn($expr, $params = array(), $not = false)
{ {
$params = (array) $params; $params = (array) $params;
// if there's no params, return (else we'll get a WHERE IN (), invalid SQL)
if (!count($params))
return;
$a = array(); $a = array();
foreach ($params as $k => $value) { foreach ($params as $k => $value) {
if ($value instanceof Doctrine_Expression) { if ($value instanceof Doctrine_Expression) {