- $notice = new Notice();
-
- # XXX: chokety and bad
-
- $notice->whereAdd('EXISTS (SELECT subscribed from subscription where subscriber = '.$profile->id.' and subscribed = notice.profile_id)', 'OR');
- $notice->whereAdd('profile_id = ' . $profile->id, 'OR');
-
- # XXX: since
- # XXX: since_id
-
- $notice->orderBy('created DESC, notice.id DESC');
-
- $notice->limit((($page-1)*20), $count);
-
- $cnt = $notice->find();