summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/classes/User.php b/classes/User.php
index e4928eb34..1772b82e0 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -128,4 +128,23 @@ class User extends DB_DataObject
return true;
}
+
+ function noticesWithFriends() {
+
+ $notice = new Notice();
+
+ $notice->selectAs();
+
+ $subscription = new Subscription();
+
+ $subscription->subscriber = $this->id;
+
+ $notice->joinAdd($subscription);
+ $notice->whereAdd('notice.profile_id = subscription.subscribed');
+ $notice->selectAs($subscription, 'sub_%');
+
+ $notice->orderBy('created DESC, notice.id DESC');
+
+ return $notice;
+ }
}