diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2010-01-15 13:36:16 -0800 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-15 13:36:16 -0800 |
| commit | 916da15cbb7f24a68be27ef4170be864d51027c4 (patch) | |
| tree | d4bae77ea1290dd6f25348d488a751c2247aaab5 /modules/gallery/libraries | |
| parent | 1066e64354ff44f88c7dd0de3bb3e50411458523 (diff) | |
| parent | 260660b2f61e96372686eacce2ce7b66a40be4a2 (diff) | |
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
Diffstat (limited to 'modules/gallery/libraries')
| -rw-r--r-- | modules/gallery/libraries/MY_ORM.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/modules/gallery/libraries/MY_ORM.php b/modules/gallery/libraries/MY_ORM.php index 56c776aa..1bf5dd13 100644 --- a/modules/gallery/libraries/MY_ORM.php +++ b/modules/gallery/libraries/MY_ORM.php @@ -19,12 +19,11 @@ */ class ORM extends ORM_Core { // Track the original value of this ORM so that we can look it up in ORM::original() - protected $original = null; + protected $original; public function save() { model_cache::clear(); $result = parent::save(); - $this->original = clone $this; return $result; } @@ -48,7 +47,24 @@ class ORM extends ORM_Core { return parent::__unset($column); } + public function reload($reload_all=true) { + if ($reload_all) { + parent::reload(); + } + $this->original = clone $this; + return $this; + } + + public function clear() { + parent::clear(); + $this->original = clone $this; + return $this; + } + public function original() { + if (!isset($this->original)) { + $this->original = clone $this; + } return $this->original; } } |
