public function UpdateQuery::__construct

public UpdateQuery::__construct(DatabaseConnection $connection, $table, array $options = array())

Constructs an UpdateQuery object.

Parameters

DatabaseConnection $connection: A DatabaseConnection object.

string $table: Name of the table to associate with this query.

array $options: Array of database options.

Overrides Query::__construct

File

includes/database/query.inc, line 1020
Non-specific Database query code. Used by all engines.

Class

UpdateQuery
General class for an abstracted UPDATE operation.

Code

public function __construct(DatabaseConnection $connection, $table, array $options = array()) {
  $options['return'] = Database::RETURN_AFFECTED;
  parent::__construct($connection, $options);
  $this->table = $table;

  $this->condition = new DatabaseCondition('AND');
}

© 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/UpdateQuery::__construct/7.x