summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2010-02-12 20:59:24 +0000
committerJamie Matthews <[email protected]>2010-02-12 20:59:24 +0000
commit80021764ae1b11f5ab2004eedf3911cea5b70495 (patch)
tree0cf04c52d283bc32ba7fc2d937ed90b3fa55e829 /README.markdown
parent7d65ce07f0e751f9f07299668f31f942d42bad78 (diff)
Added ORDER BY to queries
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown6
1 files changed, 6 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 47a1382..21da892 100644
--- a/README.markdown
+++ b/README.markdown
@@ -96,6 +96,12 @@ The `limit` and `offset` methods map pretty closely to their SQL equivalents.
ORM::for_table('person')->where('gender', 'female')->limit(5)->offset(10)->find_many();
+#### ORDER BY ####
+
+Two methods are provided to add `ORDER BY` clauses to your query. These are `order_by_desc` and `order_by_asc`, each of which takes a column name to sort by.
+
+ ORM::for_table('person')->order_by_asc('gender')->order_by_desc('name')->find_many();
+
### Getting data from objects ###
Once you've got a set of records (objects) back from a query, you can access properties on those objects (the values stored in the columns in its corresponding table) in two ways: by using the `get` method, or simply by accessing the property on the object directly: