Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Merge.php

function Merge::key

Sets a single key field to be used as condition for this query.

Same as \Drupal\Core\Database\Query\Merge::keys() but offering a signature that is more natural for the case of a single key.

Parameters

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

mixed $value: The value to set into the database.

Return value

$this

See also

\Drupal\Core\Database\Query\Merge::keys()

File

core/lib/Drupal/Core/Database/Query/Merge.php, line 329

Class

Merge
General class for an abstracted MERGE query operation.

Namespace

Drupal\Core\Database\Query

Code

public function key($field, $value = NULL) {
    assert(is_string($field));
    $this->keys([
        $field => $value,
    ]);
    return $this;
}
RSS feed
Powered by Drupal