summaryrefslogtreecommitdiff
path: root/modules/user/models
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-02 12:09:00 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-02 12:09:00 -0700
commit7ad0808a117fd1db4e94da8d7763ccca1d69350a (patch)
tree3102d84609cfb0412cf431c4ea97fb7c35748d71 /modules/user/models
parentf034c6c534ad6a07dacc6e64c7e6b43f139c3831 (diff)
Change the API for getting to the original state of an ORM.
Old API: $obj->original("field_name") New API: $obj->original()->field_name This allows us to revert the varous xxx_updated events back to passing an original ORM as well as the the updated one. This makes for a cleaner event API. Old API: comment_updated($comment) { $comment->original("field_name") } Old API: comment_updated($old, $new) { $old->field_name }
Diffstat (limited to 'modules/user/models')
-rw-r--r--modules/user/models/group.php2
-rw-r--r--modules/user/models/user.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/user/models/group.php b/modules/user/models/group.php
index bb3fb58b..8af78012 100644
--- a/modules/user/models/group.php
+++ b/modules/user/models/group.php
@@ -41,7 +41,7 @@ class Group_Model extends ORM {
if (isset($created)) {
module::event("group_created", $this);
} else {
- module::event("group_updated", $this);
+ module::event("group_updated", $this->original(), $this);
}
return $this;
}
diff --git a/modules/user/models/user.php b/modules/user/models/user.php
index def65a6f..4b43adff 100644
--- a/modules/user/models/user.php
+++ b/modules/user/models/user.php
@@ -68,7 +68,7 @@ class User_Model extends ORM {
if (isset($created)) {
module::event("user_created", $this);
} else {
- module::event("user_updated", $this);
+ module::event("user_updated", $this->original(), $this);
}
return $this;
}