8.5.x database.inc db_or()
8.0.x database.inc db_or()
8.1.x database.inc db_or()
8.2.x database.inc db_or()
8.3.x database.inc db_or()
8.4.x database.inc db_or()
8.6.x database.inc db_or()
7.x database.inc db_or()

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

Return value

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


as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an OR conjunction: new Condition('OR');

See also


Related topics

12 calls to db_or()
Access::query in core/modules/node/src/Plugin/views/filter/Access.php
See _node_access_where_sql() for a non-views query based implementation.
Current::query in core/modules/user/src/Plugin/views/filter/Current.php
Add this filter to the query.
EntityReference::query in core/modules/views/src/Plugin/views/display/EntityReference.php
Add anything to the query that we might need to.
hook_query_TAG_alter in core/lib/Drupal/Core/Database/database.api.php
Perform alterations to a structured query for a given tag.
ManyToOneHelper::addFilter in core/modules/views/src/ManyToOneHelper.php

... See full list


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


function db_or() {
  return new Condition('OR');