profile_id); } return $result; } function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0) { $ids = Notice::stream(array('Reply', '_streamDirect'), array($user_id), 'reply:stream:' . $user_id, $offset, $limit, $since_id, $max_id); return $ids; } function _streamDirect($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0) { $reply = new Reply(); $reply->profile_id = $user_id; if ($since_id != 0) { $reply->whereAdd('notice_id > ' . $since_id); } if ($max_id != 0) { $reply->whereAdd('notice_id <= ' . $max_id); } $reply->orderBy('notice_id DESC'); if (!is_null($offset)) { $reply->limit($offset, $limit); } $ids = array(); if ($reply->find()) { while ($reply->fetch()) { $ids[] = $reply->notice_id; } } return $ids; } }