From f0a290fc7617f62e7e53bd4659f541a9c340ba1c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 17 Jan 2010 13:29:36 -0800 Subject: 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. --- modules/gallery/libraries/MY_ORM.php | 4 ++++ 1 file changed, 4 insertions(+) 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; } } -- cgit v1.2.3