Looking at the documentation for QueryConditionInterface::condition(), the default value for $operation is reported to be NULL, while Conditional clauses reports the default value is '='.

What is the default value? Does it change basing on the datatype of $value? For example, when $value is an array, then the default value is 'IN'; when it's a string or an integer, then the default value is '='.


QueryConditionInterface is just that, an interface. The actual class used is DatabaseCondition.

In DatabaseCondition:condition(), it does set the default operator:

if (!isset($operator)) {
  if (is_array($value)) {
    $operator = 'IN';
  elseif (!isset($value)) {
    $operator = 'IS NULL';
  else {
    $operator = '=';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.