Browse Source

Allow null values for fields in batchInsert

tags/2.0.0-beta
Scott Tester 11 years ago
parent
commit
7ce4702426
  1. 3
      framework/db/QueryBuilder.php

3
framework/db/QueryBuilder.php

@ -177,7 +177,8 @@ class QueryBuilder extends \yii\base\Object
if (!is_array($value) && isset($columnSchemas[$columns[$i]])) {
$value = $columnSchemas[$columns[$i]]->typecast($value);
}
$vs[] = is_string($value) ? $this->db->quoteValue($value) : $value;
$vs[] = is_string($value) ? $this->db->quoteValue($value)
: ( is_null($value) ? 'null' : $value );
}
$values[] = '(' . implode(', ', $vs) . ')';
}

Loading…
Cancel
Save