summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-12-18 01:12:16 -0800
committerBharat Mediratta <bharat@menalto.com>2009-12-18 01:12:16 -0800
commitca1f7d0da7495aaa2558ddad134f14164a550ab3 (patch)
tree99d2bacaeb56b66d4ce7b43c336bf8832c6405a2
parentc10386fe87f9fe0d659e730d171800f26f809604 (diff)
Convert a database query.
-rw-r--r--modules/gallery/models/item.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index d7ddcd02..e2208b73 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -120,11 +120,13 @@ class Item_Model extends ORM_MPTT {
if ($this->is_album()) {
@rename(dirname($original_resize_path), dirname($this->resize_path()));
@rename(dirname($original_thumb_path), dirname($this->thumb_path()));
- Database::instance()
- ->update("items",
- array("relative_path_cache" => null,
- "relative_url_cache" => null),
- array("left_ptr >" => $this->left_ptr, "right_ptr <" => $this->right_ptr));
+ db::build()
+ ->update("items")
+ ->set("relative_path_cache", null)
+ ->set("relative_url_cache", null)
+ ->where("left_ptr", ">", $this->left_ptr)
+ ->where("right_ptr", "<", $this->right_ptr)
+ ->execute();
} else {
@rename($original_resize_path, $this->resize_path());
@rename($original_thumb_path, $this->thumb_path());