summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-17 13:29:36 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-17 13:29:36 -0800
commitf0a290fc7617f62e7e53bd4659f541a9c340ba1c (patch)
tree89b36fc8b8a3ad951428632ec5dc9bee1502e47b
parentcfb27dde023e4f4d04fc9de687548501e607d371 (diff)
If we call original() and there's no $original yet, then consider this
to be the original. That should be safe because we're already guarding __set, __unset and save.
-rw-r--r--modules/gallery/libraries/MY_ORM.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gallery/libraries/MY_ORM.php b/modules/gallery/libraries/MY_ORM.php
index 56c776aa..8c0f084f 100644
--- a/modules/gallery/libraries/MY_ORM.php
+++ b/modules/gallery/libraries/MY_ORM.php
@@ -49,6 +49,10 @@ class ORM extends ORM_Core {
}
public function original() {
+ if (!isset($this->original)) {
+ $this->original = clone $this;
+ }
+
return $this->original;
}
}