function db_merge

You are here

7 db_merge($table, array $options = array())
8 db_merge($table, array $options = array())

Returns a new MergeQuery object for the active database.


$table: The table into which to merge.

$options: An array of options to control how the query operates.

Return value

\Drupal\Core\Database\Query\Merge A new Merge object for this connection.

Related topics

21 calls to db_merge()
drupal-7.state.system.database.php in core/modules/system/tests/upgrade/drupal-7.state.system.database.php
Database additions for state system upgrade tests.
GarbageCollectionTest::testGarbageCollection in core/modules/system/lib/Drupal/system/Tests/KeyValueStore/GarbageCollectionTest.php
Tests garbage collection.
history_write in core/modules/history/history.module
Updates 'last viewed' timestamp of the specified entity for the current user.
hook_entity_predelete in core/modules/system/entity.api.php
Act before entity deletion.
hook_user_role_update in core/modules/user/user.api.php
Inform other modules that a user role has been updated.

... See full list


core/includes/, line 316
Core systems for the database layer.


function db_merge($table, array $options = array()) {
  if (empty($options['target']) || $options['target'] == 'slave') {
    $options['target'] = 'default';
  return Database::getConnection($options['target'])->merge($table, $options);