function Update::fields

Same name in other branches
  1. 9 core/lib/Drupal/Core/Database/Query/Update.php \Drupal\Core\Database\Query\Update::fields()
  2. 8.9.x core/lib/Drupal/Core/Database/Query/Update.php \Drupal\Core\Database\Query\Update::fields()
  3. 11.x core/lib/Drupal/Core/Database/Query/Update.php \Drupal\Core\Database\Query\Update::fields()

Adds a set of field->value pairs to be updated.

Parameters

$fields: An associative array of fields to write into the database. The array keys are the field names and the values are the values to which to set them.

Return value

$this The called object.

File

core/lib/Drupal/Core/Database/Query/Update.php, line 83

Class

Update
General class for an abstracted UPDATE operation.

Namespace

Drupal\Core\Database\Query

Code

public function fields(array $fields) {
    $this->fields = $fields;
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.