diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-09-07 21:30:48 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-09-07 21:30:48 -0700 |
commit | 86f88769f9f636d5fbc75cc39b6f3b78b6ed5893 (patch) | |
tree | e6783843c86d1e719a1b03e2453c6d17baa14b24 | |
parent | 78a42d9b8397e36bdd2a84e1fd6b4f49f0873b78 (diff) |
Update Item_Model::save() to consider the relative_xxx_cache fields as
insignificant, in addition to the view_count field. This means that
we won't trigger an event, nor will we adjust the updated field if
*only* those fields are changed.
-rw-r--r-- | modules/gallery/models/item.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index a2c49154..0ec5d048 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -349,7 +349,12 @@ class Item_Model extends ORM_MPTT { * @see ORM::save() */ public function save() { - if (!empty($this->changed) && $this->changed != array("view_count" => "view_count")) { + $significant_changes = $this->changed; + unset($significant_changes["view_count"]); + unset($significant_changes["relative_url_cache"]); + unset($significant_changes["relative_path_cache"]); + + if (!empty($this->changed) && $significant_changes) { $this->updated = time(); if (!$this->loaded) { $this->created = $this->updated; |