diff options
Diffstat (limited to 'modules/gallery/helpers/gallery_event.php')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 02bfdf28..301432d4 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -30,36 +30,37 @@ class gallery_event_Core { static function user_deleted($user) { $admin = identity::admin_user(); - $db = Database::instance(); - $db->from("tasks") - ->set(array("owner_id" => $admin->id)) - ->where(array("owner_id" => $user->id)) - ->update(); - $db->from("items") - ->set(array("owner_id" => $admin->id)) - ->where(array("owner_id" => $user->id)) - ->update(); - $db->from("logs") - ->set(array("user_id" => $admin->id)) - ->where(array("user_id" => $user->id)) - ->update(); + db::build() + ->update("tasks") + ->set("owner_id", $admin->id) + ->where("owner_id", "=", $user->id) + ->execute(); + db::build() + ->update("items") + ->set("owner_id", $admin->id) + ->where("owner_id", "=", $user->id) + ->execute(); + db::build() + ->update("logs") + ->set("user_id", $admin->id) + ->where("user_id", "=", $user->id) + ->execute(); } static function identity_provider_changed($old_provider, $new_provider) { $admin = identity::admin_user(); - $db = Database::instance(); - $db->from("tasks") - ->set(array("owner_id" => $admin->id)) - ->where("1 = 1") - ->update(); - $db->from("items") - ->set(array("owner_id" => $admin->id)) - ->where("1 = 1") - ->update(); - $db->from("logs") - ->set(array("user_id" => $admin->id)) - ->where("1 = 1") - ->update(); + db::build() + ->update("tasks") + ->set("owner_id", $admin->id) + ->execute(); + db::build() + ->update("items") + ->set("owner_id", $admin->id) + ->execute(); + db::build() + ->update("logs") + ->set("user_id", $admin->id) + ->execute(); } static function group_created($group) { |