return empty array when passing empty as SQLvalue
parent
73c2415f83
commit
837d0ece7f
|
@ -98,9 +98,13 @@ class ZM_Object {
|
||||||
if ( $value == null ) {
|
if ( $value == null ) {
|
||||||
$fields[] = '`'.$field.'` IS NULL';
|
$fields[] = '`'.$field.'` IS NULL';
|
||||||
} else if ( is_array($value) ) {
|
} else if ( is_array($value) ) {
|
||||||
|
if ( count($value) ) {
|
||||||
$func = function(){return '?';};
|
$func = function(){return '?';};
|
||||||
$fields[] = '`'.$field.'` IN ('.implode(',', array_map($func, $value)). ')';
|
$fields[] = '`'.$field.'` IN ('.implode(',', array_map($func, $value)). ')';
|
||||||
$values += $value;
|
$values += $value;
|
||||||
|
} else {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$fields[] = '`'.$field.'`=?';
|
$fields[] = '`'.$field.'`=?';
|
||||||
|
|
Loading…
Reference in New Issue