X-Git-Url: https://git.mxchange.org/?p=quix0rs-gnu-social.git;a=blobdiff_plain;f=plugins%2FEvent%2Fclasses%2FHappening.php;h=fd8c3c8a2aaf6ff841b6461ce48b4295bd30d924;hp=9962815a67ad14cacac70c129cdd6773f029c91a;hb=e2d85a39e7f82ceef2cb2fe66a3a9a62ac9a363e;hpb=9b7773343460514c5c5811c9add5cd96a2770c42 diff --git a/plugins/Event/classes/Happening.php b/plugins/Event/classes/Happening.php index 9962815a67..fd8c3c8a2a 100644 --- a/plugins/Event/classes/Happening.php +++ b/plugins/Event/classes/Happening.php @@ -27,9 +27,7 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } /** * Data class for happenings @@ -172,14 +170,14 @@ class Happening extends Managed_DataObject $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', @@ -202,14 +200,19 @@ class Happening extends Managed_DataObject 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 $notice) { - return Happening::getKV('uri', $notice->uri); + return Happening::getKV('uri', $notice->getUri()); } function getRSVPs() @@ -219,7 +222,7 @@ class Happening extends Managed_DataObject function getRSVP($profile) { - return RSVP::pkeyGet(array('profile_id' => $profile->id, - 'event_id' => $this->id)); + return RSVP::pkeyGet(array('profile_id' => $profile->getID(), + 'event_uri' => $this->getUri())); } }