From 774e0b3737d51b70bb141f4e13c6c111208847c0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 20 May 2009 06:10:14 +0000 Subject: Avoid complex inserts in available_tasks() to make admin/maintenance run faster. This fixes ticket #235. Incidentally, refactor exif and search to use the same patterns overall so that if you understand one, you understand the other and they generally use the same strings for localization. --- modules/search/helpers/search_event.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'modules/search/helpers/search_event.php') diff --git a/modules/search/helpers/search_event.php b/modules/search/helpers/search_event.php index 50a968e7..b9657395 100644 --- a/modules/search/helpers/search_event.php +++ b/modules/search/helpers/search_event.php @@ -19,16 +19,11 @@ */ class search_event_Core { static function item_created($item) { - $record = ORM::factory("search_record"); - $record->item_id = $item->id; - search::update_record($record); + search::update($item); } static function item_updated($old_item, $new_item) { - $record = ORM::factory("search_record") - ->where("item_id", $new_item->id) - ->find(); - search::update_record($record); + search::update($new_item); } static function item_before_delete($item) { @@ -38,10 +33,7 @@ class search_event_Core { } static function item_related_update($item) { - $record = ORM::factory("search_record") - ->where("item_id", $item->id) - ->find(); - search::update_record($record); + search::update($item); } static function item_related_update_batch($sql) { -- cgit v1.2.3