summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2010-02-13 13:06:06 +0000
committerJamie Matthews <[email protected]>2010-02-13 13:06:06 +0000
commit78cbb3e73ca7c615cde82bf440128e6e71c8bc1a (patch)
tree9cbc4528c097b4248bc13ef1298ddddd148fea74 /README.markdown
parentd5854cbe3dc605b09dd9dab094a9e4a9d0054f03 (diff)
Added where_like method, documentation and tests. Changing API to use alternate method calls instead of class constants to specify WHERE operator.
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown10
1 files changed, 8 insertions, 2 deletions
diff --git a/README.markdown b/README.markdown
index 2b90921..f537a26 100644
--- a/README.markdown
+++ b/README.markdown
@@ -84,9 +84,15 @@ To find all records where the `gender` is `female`:
#### WHERE clauses ####
-The `where` method on the ORM class adds a single `WHERE` clause to your query. The method may be called (chained) multiple times to add more than one WHERE clause. All the WHERE clauses will be ANDed together when the query is run. Support for ORing WHERE clauses is not currently present; if a query requires an OR clause you should use the `where_raw` or `raw_select` methods (see below). [TODO]
+The `where` method on the ORM class adds a single `WHERE` clause to your query. The method may be called (chained) multiple times to add more than one WHERE clause. All the WHERE clauses will be ANDed together when the query is run. Support for ORing WHERE clauses is not currently present; if a query requires an OR clause you should use the `where_raw` or `raw_select` methods (see below).
-By default, calling `where` with two parameters (the column name and the value) will combine them using an equals operator (`=`). For example, calling `where('name', 'Fred')` will result in the clause `WHERE name = "Fred"`. However, the `where` method takes an optional third parameter which specifies the type of operator to use. Constants for each operator are provided on the ORM class. Currently, the supported operators are: `ORM::EQUALS` and `ORM::LIKE`.
+By default, calling `where` with two parameters (the column name and the value) will combine them using an equals operator (`=`). For example, calling `where('name', 'Fred')` will result in the clause `WHERE name = "Fred"`. To use other types of operator, you can use one of the alternate `where_*` methods below.
+
+##### LIKE #####
+
+To add a `WHERE ... LIKE` clause, use:
+
+ ORM::for_table('person')->where_like('Name', '%fred%')->find_many();
#### Raw WHERE clauses ####