Skip to content

Commit

Permalink
Update ORM::where() calls to take 3 args.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Nov 26, 2009
1 parent 2ee38b3 commit 22823df
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions modules/notification/helpers/notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ static function get_subscription($item_id, $user=null) {
}

return ORM::factory("subscription")
->where("item_id", $item_id)
->where("user_id", $user->id)
->where("item_id", "=", $item_id)
->where("user_id", "=", $user->id)
->find();
}

Expand All @@ -35,8 +35,8 @@ static function is_watching($item, $user=null) {
}

return ORM::factory("subscription")
->where("item_id", $item->id)
->where("user_id", $user->id)
->where("item_id", "=", $item->id)
->where("user_id", "=", $user->id)
->find()
->loaded();
}
Expand All @@ -60,8 +60,8 @@ static function remove_watch($item, $user=null) {
}

$subscription = ORM::factory("subscription")
->where("item_id", $item->id)
->where("user_id", $user->id)
->where("item_id", "=", $item->id)
->where("user_id", "=", $user->id)
->find()->delete();
}
}
Expand All @@ -71,8 +71,8 @@ static function get_subscribers($item) {
foreach (ORM::factory("subscription")
->select("user_id")
->join("items", "subscriptions.item_id", "items.id")
->where("items.left_ptr <=", $item->left_ptr)
->where("items.right_ptr >", $item->right_ptr)
->where("items.left_ptr", "<=", $item->left_ptr)
->where("items.right_ptr", ">", $item->right_ptr)
->find_all()
->as_array() as $subscriber) {
$subscriber_ids[] = $subscriber->user_id;
Expand Down Expand Up @@ -176,7 +176,7 @@ static function send_pending_notifications() {
->get() as $row) {
$email = $row->email;
$result = ORM::factory("pending_notification")
->where("email", $email)
->where("email", "=", $email)
->find_all();
if ($result->count() == 1) {
$pending = $result->current();
Expand Down

0 comments on commit 22823df

Please sign in to comment.