Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2013 at 05:12 UTC
Updated:
24 Apr 2013 at 15:21 UTC
Jump to comment: Most recent
Comments
Comment #1
jhodgdonGood idea to make the documentation more clear! However, saying it can be an array of strings does not explain what that would mean, especially since $field can also be an array. I am not sure what the answer is... any idea?
Comment #2
marblegravy commentedNot quite sure where the confusion is because I'm only talking about changing the text for the $value parameter, and $field's description at the moment already says:
What if the help text for $value became:
Would an example help? There are plenty in the comments:
->fieldCondition('field_foo', 'tid', array('1', '2'))Checks the tid column for 1 or 2.
->fieldCondition('field_foo', 'tid', '2')Checks the tid column for only 2.
Comment #3
jhodgdonI guess that $field is something representing a single field, which can be either a string or a field array. Then $column is a database column within that field, and $value/$operator define the condition on the column, with $operator defaulting to = if it's a single value, and IN if it's an array (just like standard query conditions).
So... let's make sure the documentation says this. I think the best way to indicate data types is to put data types on all of the parameters:
http://drupal.org/coding-standards/docs#param
http://drupal.org/coding-standards/docs#types