diff options
Diffstat (limited to 'core/models/item.php')
-rw-r--r-- | core/models/item.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/models/item.php b/core/models/item.php index e5eb4039..d71414d8 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -237,4 +237,17 @@ class Item_Model extends ORM_MPTT { return parent::__get($column); } } + + /** + * @see ORM::save() + */ + public function save() { + if (!empty($this->changed) && $this->changed != array("view_count" => "view_count")) { + $this->updated = time(); + if (!$this->loaded) { + $this->created = $this->updated; + } + } + return parent::save(); + } } |