You are here

public function Upsert::key in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/Query/Upsert.php \Drupal\Core\Database\Query\Upsert::key()
  2. 9 core/lib/Drupal/Core/Database/Query/Upsert.php \Drupal\Core\Database\Query\Upsert::key()

Sets the unique / primary key field to be used as condition for this query.

Parameters

string $field: The name of the field to set.

Return value

$this

File

core/lib/Drupal/Core/Database/Query/Upsert.php, line 53

Class

Upsert
General class for an abstracted "Upsert" (UPDATE or INSERT) query operation.

Namespace

Drupal\Core\Database\Query

Code

public function key($field) {
  $this->key = $field;
  return $this;
}