Esempio n. 1
0
 function activityObjectFromNoticePollResponse(Notice $notice)
 {
     $object = new ActivityObject();
     $object->id = $notice->uri;
     $object->type = self::POLL_RESPONSE_OBJECT;
     $object->title = $notice->content;
     $object->summary = $notice->content;
     $object->link = $notice->getUrl();
     $response = Poll_response::getByNotice($notice);
     if ($response) {
         $poll = $response->getPoll();
         if ($poll) {
             // Stash data to be formatted later by
             // $this->activityObjectOutputAtom() or
             // $this->activityObjectOutputJson()...
             $object->pollSelection = intval($response->selection);
             $object->pollUri = $poll->uri;
         }
     }
     return $object;
 }