| Versionen | |
|---|---|
| drupal7 | public MergeQuery::fields(array $fields, array $values = array()) |
Set the field->value pairs to be merged into the table.
This method should only be called once. It may be called either with a single associative array or two indexed arrays. If called with an associative array, the keys are taken to be the fields and the values are taken to be the corresponding values to set. If called with two arrays, the first array is taken as the fields and the second array is taken as the corresponding values.
$fields An array of fields to set.
$values An array of fields to set into the database. The values must be specified in the same order as the $fields array.
The called object.
includes/
<?php
public function fields(array $fields, array $values = array()) {
if (count($values) > 0) {
$fields = array_combine($fields, $values);
}
$this->insertFields = $fields;
return $this;
}
?>
Kommentare
Kommentar hinzufügen