diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-11-26 12:09:04 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-11-26 12:09:04 -0800 |
commit | 1fd0e14359a7c7164573e4aa897c07680339e713 (patch) | |
tree | 62b01b88571e53810aa7f3efc2f0f01e727904e2 /modules/comment | |
parent | 22823df22098ed1a69d88c2e5fdc30cd90f72c30 (diff) |
Convert all DB where() calls to take 3 arguments.
Convert all open_paren() calls to and_open() or or_open() as appropriate.
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/controllers/admin_comments.php | 4 | ||||
-rw-r--r-- | modules/comment/helpers/comment_event.php | 6 | ||||
-rw-r--r-- | modules/comment/helpers/comment_rss.php | 4 | ||||
-rw-r--r-- | modules/comment/helpers/comment_theme.php | 4 | ||||
-rw-r--r-- | modules/comment/tests/Comment_Model_Test.php | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php index 039956d7..271c7d51 100644 --- a/modules/comment/controllers/admin_comments.php +++ b/modules/comment/controllers/admin_comments.php @@ -49,7 +49,7 @@ class Admin_Comments_Controller extends Admin_Controller { $view->content->state = $state; $view->content->comments = ORM::factory("comment") ->order_by("created", "DESC") - ->where("state", $state) + ->where("state", "=", $state) ->limit(self::$items_per_page, ($page - 1) * self::$items_per_page) ->find_all(); $view->content->pager = new Pagination(); @@ -120,7 +120,7 @@ class Admin_Comments_Controller extends Admin_Controller { access::verify_csrf(); ORM::factory("comment") - ->where("state", "spam") + ->where("state", "=", "spam") ->delete_all(); url::redirect("admin/comments/queue/spam"); } diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php index a72102b9..cf5d0a60 100644 --- a/modules/comment/helpers/comment_event.php +++ b/modules/comment/helpers/comment_event.php @@ -29,7 +29,7 @@ class comment_event_Core { "guest_email" => null, "guest_name" => "guest", "guest_url" => null)) - ->where(array("author_id" => $user->id)) + ->where("author_id", "=", $user->id) ->update(); } @@ -40,7 +40,7 @@ class comment_event_Core { "guest_email" => null, "guest_name" => "guest", "guest_url" => null)) - ->where("1 = 1") + ->where("1", "=", "1") // @todo: why do we do this? ->update(); } @@ -65,7 +65,7 @@ class comment_event_Core { foreach (Database::instance() ->select("text") ->from("comments") - ->where("item_id", $item->id) + ->where("item_id", "=", $item->id) ->get() ->as_array() as $row) { $data[] = $row->text; diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index d0bb7859..77044884 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -35,11 +35,11 @@ class comment_rss_Core { $comments = ORM::factory("comment") ->viewable() - ->where("state", "published") + ->where("state", "=", "published") ->order_by("created", "DESC"); if ($feed_id == "item") { - $comments->where("item_id", $id); + $comments->where("item_id", "=", $id); } $feed->view = "comment.mrss"; diff --git a/modules/comment/helpers/comment_theme.php b/modules/comment/helpers/comment_theme.php index 2f12192b..ebcc1c42 100644 --- a/modules/comment/helpers/comment_theme.php +++ b/modules/comment/helpers/comment_theme.php @@ -37,8 +37,8 @@ class comment_theme_Core { $view = new View("comments.html"); $view->comments = ORM::factory("comment") - ->where("item_id", $theme->item()->id) - ->where("state", "published") + ->where("item_id", "=", $theme->item()->id) + ->where("state", "=", "published") ->order_by("created", "ASC") ->find_all(); diff --git a/modules/comment/tests/Comment_Model_Test.php b/modules/comment/tests/Comment_Model_Test.php index de19648d..aa91d6f2 100644 --- a/modules/comment/tests/Comment_Model_Test.php +++ b/modules/comment/tests/Comment_Model_Test.php @@ -29,12 +29,12 @@ class Comment_Model_Test extends Unit_Test_Case { access::allow(identity::everybody(), "view", $album); $this->assert_equal( 1, - ORM::factory("comment")->viewable()->where("comments.id", $comment->id)->count_all()); + ORM::factory("comment")->viewable()->where("comments.id", "=", $comment->id)->count_all()); // We can't see the comment when permissions are denied on the album access::deny(identity::everybody(), "view", $album); $this->assert_equal( 0, - ORM::factory("comment")->viewable()->where("comments.id", $comment->id)->count_all()); + ORM::factory("comment")->viewable()->where("comments.id", "=", $comment->id)->count_all()); } } |