function db_update

You are here

7 database.inc db_update($table, array $options = array())
8 database.inc db_update($table, array $options = array())

Returns a new UpdateQuery object for the active database.

Parameters

$table: The table to update.

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

Return value

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

Related topics

61 calls to db_update()
AggregatorCronTest::testCron in core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorCronTest.php
Adds feeds and updates them via cron process.
DatabaseStorageTest::update in core/modules/config/lib/Drupal/config/Tests/Storage/DatabaseStorageTest.php
DeleteTest::testInUse in core/modules/file/lib/Drupal/file/Tests/DeleteTest.php
Tries deleting a file that is in use.
drupal-7.all-disabled.database.php in core/modules/system/tests/upgrade/drupal-7.all-disabled.database.php
Database additions for upgrade path tests when all non-required modules are disabled.
drupal-7.contact.database.php in core/modules/contact/tests/drupal-7.contact.database.php
Database additions for Drupal\contact\Tests\ContactUpgradePathTest.

... See full list

File

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

Code

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