public function MergeQuery::useDefaults
public MergeQuery::useDefaults(array $fields)
Specifies fields for which the database-defaults should be used.
If you want to force a given field to use the database-defined default, not NULL or undefined, use this method to instruct the database to use default values explicitly. In most cases this will not be necessary unless you are inserting a row that is all default values, as you cannot specify no values in an INSERT query.
Specifying a field both in fields() and in useDefaults() is an error and will not execute.
Parameters
$fields: An array of values for which to use the default values specified in the table definition.
Return value
MergeQuery The called object.
File
- includes/database/query.inc, line 1449
- Non-specific Database query code. Used by all engines.
Class
- MergeQuery
- General class for an abstracted MERGE query operation.
Code
public function useDefaults(array $fields) { $this->defaultFields = $fields; return $this; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!database!query.inc/function/MergeQuery::useDefaults/7.x