summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2011-01-08 11:57:33 +0000
committerJamie Matthews <[email protected]>2011-01-08 11:57:33 +0000
commit72066a7b0e20d9ea61eb44273439af97d52cbea9 (patch)
treef6d71f0f79a8c06df1c4dbd41a97659c21207af5 /README.markdown
parent61bef969fdb54a754963d8e45356591193a2a378 (diff)
Add is_dirty method to check whether a field has modified
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 b6ef1a6..9a93ffa 100644
--- a/README.markdown
+++ b/README.markdown
@@ -313,6 +313,12 @@ To add a new record, you need to first create an "empty" object instance. You th
After the object has been saved, you can call its `id()` method to find the autogenerated primary key value that the database assigned to it.
+### Checking whether a property has been modified ###
+
+To check whether a property has been changed since the object was created (or last saved), call the `is_dirty` method:
+
+ $name_has_changed = $person->is_dirty('name'); // Returns true or false
+
### Deleting records ###
To delete an object from the database, simply call its `delete` method.