Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Jan 2010 at 17:06 UTC
Updated:
3 Jan 2014 at 01:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
agentrickardAnd the patch file.
Comment #2
dries commentedNice little improvement. Committed to CVS HEAD.
Comment #3
Crell commentedThis patch is wrong. db_condition wraps the constructor for DatabaseCondition. The conjunction is for joining two or more conditional clauses. IN, BETWEEN, NOT NULL, and the rest are conditional comparators like = and >, not conjunctions. If you pass NOT NULL to a db_condition(), you'll get the following syntax error:
WHERE foo = bar NOT NULL baz = bobThe ->condition() method takes conditional comparators. That is not the same as db_condition(), which is a factory for the DatabaseCondition class. Really, you should never use db_condition() directly. Use db_or(), db_and(), and db_xor(). db_condition() is only there in case there's another conjunction that we forgot, which I don't think we did.
This needs to be rolled back.
Comment #4
agentrickardYou still need to document the @param as $conjunction, though.
@Crell -- any idea where we can put the operator list in the API docs?
Comment #5
agentrickardRevised patch which reverts the error and provides accurate docs.
Comment #6
Crell commentedThe first hunk in #5 is incorrect, since "AND" is not an operator. The operators are = (the default), <, >, <=, >=, IN, NOT IN, LIKE, NOT LIKE, BETWEEN, and anything else SQL supports there (except for IS NULL and IS NOT NULL, which have their own utility methods). I don't think an exhaustive list there is even wise, since it's just replicating a large chunk of core SQL documentation.
I'd rather beef up the description there to define what sorts of things go there, with a few examples, rather than try to make an exhaustive list and miss one.
Comment #7
Crell commentedLet's try this.
Comment #8
agentrickardOops. Typo. (funciton). Maybe this?
Comment #9
Crell commentedD'Oh! Yes.
Comment #10
dries commentedCommitted to CVS HEAD.