From 44bc74edb9ae77bfaeb70f708411026131ec12bb Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 28 Jul 2009 20:30:34 -0700 Subject: Change search callbacks to use the event system, so move them out of xxx_search helpers and into xxx_event helpers. --- modules/comment/helpers/comment_event.php | 11 ++++++++++ modules/comment/helpers/comment_search.php | 34 ------------------------------ 2 files changed, 11 insertions(+), 34 deletions(-) delete mode 100644 modules/comment/helpers/comment_search.php (limited to 'modules/comment/helpers') diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php index 614c7c65..0234aea9 100644 --- a/modules/comment/helpers/comment_event.php +++ b/modules/comment/helpers/comment_event.php @@ -38,4 +38,15 @@ class comment_event_Core { ->url("#comments") ->css_id("gCommentsLink")); } + + static function item_index_data($item, $data) { + foreach (Database::instance() + ->select("text") + ->from("comments") + ->where("item_id", $item->id) + ->get() + ->as_array() as $row) { + $data[] = $row->text; + } + } } diff --git a/modules/comment/helpers/comment_search.php b/modules/comment/helpers/comment_search.php deleted file mode 100644 index 29762eae..00000000 --- a/modules/comment/helpers/comment_search.php +++ /dev/null @@ -1,34 +0,0 @@ -select("text") - ->from("comments") - ->where("item_id", $item->id) - ->get() - ->as_array() as $row) { - $data[] = $row->text; - } - return join(" ", $data); - } -} -- cgit v1.2.3