summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2010-11-13 12:08:55 +0000
committerJamie Matthews <[email protected]>2010-11-13 12:08:55 +0000
commit3dad80a0c007862cbef7a76e7d9de795fe350734 (patch)
treeb012441bc0762a708fc79042566e748c03800883 /README.markdown
parent9a639619d80c9b0d640a3a79fd8779a375c5b28b (diff)
Add documentation on transactions. Closes issue #9
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 75d9a28..bb0c324 100644
--- a/README.markdown
+++ b/README.markdown
@@ -318,6 +318,21 @@ To delete an object from the database, simply call its `delete` method.
$person = ORM::for_table('person')->find_one(5);
$person->delete();
+### Transactions ###
+
+Idiorm doesn't supply any extra methods to deal with transactions, but it's very easy to use PDO's built-in methods:
+
+ // Start a transaction
+ ORM::get_db()->beginTransaction();
+
+ // Commit a transaction
+ ORM::get_db()->commit();
+
+ // Roll back a transaction
+ ORM::get_db()->rollBack();
+
+For more details, see [the PDO documentation on Transactions](http://www.php.net/manual/en/pdo.transactions.php).
+
### Configuration ###
Other than setting the DSN string for the database connection (see above), the `configure` method can be used to set some other simple options on the ORM class. Modifying settings involves passing a key/value pair to the `configure` method, representing the setting you wish to modify and the value you wish to set it to.