You are here

function db_xor in Drupal 8

Same name and namespace in other branches
  1. 7 includes/database/database.inc \db_xor()

Returns a new DatabaseCondition, set to "XOR" all conditions together.

Return value

\Drupal\Core\Database\Query\Condition A new Condition object, set to "XOR" all conditions together.

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying a XOR conjunction: new Condition('XOR');

See also

https://www.drupal.org/node/2993033

\Drupal\Core\Database\Query\Condition

Related topics

1 call to db_xor()
DatabaseLegacyTest::testDbXor in core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php
Tests deprecation of the db_xor() function.

File

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

Code

function db_xor() {
  @trigger_error('db_xor() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Create a \\Drupal\\Core\\Database\\Query\\Condition object, specifying a XOR conjunction: new Condition(\'XOR\'), instead. See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
  return new Condition('XOR');
}