API page: http://api.drupal.org/api/drupal/includes--database--query.inc/function/...

Describe the problem you have found:

$field can also be an object, but the docs say:

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

This is done in Views, and I'm told core does this too.

Comments

jhodgdon’s picture

Title: Documentation problem with QueryConditionInterface::condition » QueryConditionInterface::condition documentation: $field and $value can be objects

True! good catch.

I'm looking at http://api.drupal.org/api/drupal/includes--database--query.inc/function/... (which I am pretty sure is where the conditions are turned into an actual WHERE clause).

And it is clear from that code that you can pass other QueryConditionInterface objects in for the $field (in order to make a compound condition like (...) OR (...).

This should be added to the doc.

Also note that $value can be a SelectQueryInterface object, so that should also be added to the doc.