public function QueryConditionInterface::condition

cis7 public QueryConditionInterface::condition($field, $value = NULL, $operator = NULL)
cle7 public QueryConditionInterface::condition($field, $value = NULL, $operator = NULL)
elmsmedia7 public QueryConditionInterface::condition($field, $value = NULL, $operator = NULL)
icor7 public QueryConditionInterface::condition($field, $value = NULL, $operator = NULL)
meedjum_blog7 public QueryConditionInterface::condition($field, $value = NULL, $operator = NULL)
mooc7 public QueryConditionInterface::condition($field, $value = NULL, $operator = NULL)

Helper function: builds the most common conditional clauses.

This method can take a variable number of parameters. If called with two parameters, they are taken as $field and $value with $operator having a value of IN if $value is an array and = otherwise.

Do not use this method to test for NULL values. Instead, use QueryConditionInterface::isNull() or QueryConditionInterface::isNotNull().


$field: The name of the field to check. If you would like to add a more complex condition involving operators or functions, use where().

$value: The value to test the field against. In most cases, this is a scalar. For more complex options, it is an array. The meaning of each element in the array is dependent on the $operator.

$operator: The comparison operator, such as =, <, or >=. It also accepts more complex options such as IN, LIKE, or BETWEEN. Defaults to IN if $value is an array, and = otherwise.

Return value

QueryConditionInterface The called object.

See also



6 methods override QueryConditionInterface::condition()
DatabaseCondition::condition in includes/database/
Implements QueryConditionInterface::condition().
DeleteQuery::condition in includes/database/
Implements QueryConditionInterface::condition().
MergeQuery::condition in includes/database/
Implements QueryConditionInterface::condition().
SelectQuery::condition in includes/database/
Helper function: builds the most common conditional clauses.
SelectQueryExtender::condition in includes/database/
Helper function: builds the most common conditional clauses.

... See full list


includes/database/, line 46
Non-specific Database query code. Used by all engines.


Interface for a conditional clause in a query.


public function condition($field, $value = NULL, $operator = NULL);



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.