summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2010-10-07 01:03:55 +0100
committerJamie Matthews <[email protected]>2010-10-07 01:03:55 +0100
commitb9651bb00250452aa10a6b695cda627695a7bf05 (patch)
tree1e60068bd49a7bfadb9d8dc912e5dd4447bff9f7 /README.markdown
parent0e40a2014a589245005d63516cd6f2e45e392785 (diff)
Add where_in and where_not_in methods, tests and docs
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown8
1 files changed, 8 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 2c3733c..6db94ed 100644
--- a/README.markdown
+++ b/README.markdown
@@ -130,6 +130,14 @@ Similarly, to add a `WHERE ... NOT LIKE` clause, use:
$people = ORM::for_table('person')->where_not_like('Name', '%bob%')->find_many();
+#### Set membership: `where_in` and `where_not_in` #####
+
+To add a `WHERE ... IN ()` or `WHERE ... NOT IN ()` clause, use the `where_in` and `where_not_in` methods respectively.
+
+Both methods accept two arguments. The first is the column name to compare against. The second is an *array* of possible values.
+
+ $people = ORM::for_table('person')->where_in('Name', array('Fred', 'Joe', 'John')->find_many();
+
##### Raw WHERE clauses #####
If you require a more complex query, you can use the `where_raw` method to specify the SQL fragment exactly. This method takes two arguments: the string to add to the query, and an array of parameters which will be bound to the string. The string should contain question marks to represent the values to be bound, and the parameter array should contain the values to be substituted into the string in the correct order.