* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Data class for happenings
$options);
if (!array_key_exists('uri', $options)) {
- $options['uri'] = $ev->uri;
+ $options['uri'] = $ev->getUri();
}
if (!empty($url)) {
$options['urls'] = array($url);
}
- $saved = Notice::saveNew($profile->id,
+ $saved = Notice::saveNew($profile->getID(),
$content,
array_key_exists('source', $options) ?
$options['source'] : 'web',
return $this->url;
}
+ public function getUri()
+ {
+ return $this->uri;
+ }
+
function getNotice()
{
- return Notice::getKV('uri', $this->uri);
+ return Notice::getKV('uri', $this->getUri());
}
static function fromNotice($notice)
{
- return Happening::getKV('uri', $notice->uri);
+ return Happening::getKV('uri', $notice->getUri());
}
function getRSVPs()
function getRSVP($profile)
{
- return RSVP::pkeyGet(array('profile_id' => $profile->id,
+ return RSVP::pkeyGet(array('profile_id' => $profile->getID(),
'event_id' => $this->id));
}
}
$qry .= 'AND notice.id <= ' . $max_id . ' ';
}
- // NOTE: we sort by bookmark time, not by notice time!
+ // NOTE: we sort by event time, not by notice time!
$qry .= 'ORDER BY created DESC ';
if (!is_null($offset)) {
$qry .= "LIMIT $limit OFFSET $offset";
$stream = new RawEventsNoticeStream($target);
if ($target->sameAs($scoped)) {
- $key = 'bookmark:ids_by_user_own:'.$target->getID();
+ $key = 'happening:ids_for_user_own:'.$target->getID();
} else {
- $key = 'bookmark:ids_by_user:'.$target->getID();
+ $key = 'happening:ids_for_user:'.$target->getID();
}
parent::__construct(new CachingNoticeStream($stream, $key), $scoped);