-
- $notice = DB_DataObject::factory('notice');
-
- # FIXME: bad performance
-
- $notice->whereAdd('EXISTS (SELECT user.id from user where user.id = notice.profile_id)');
-
- $notice->orderBy('created DESC, notice.id DESC');
-
- if ($limit != 0) {
- $notice->limit(0, $limit);
- }
- $notice->find();
-