Conditions | 2 |
Paths | 8 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function createShareToUser(SharingFrame $frame, $userId) { |
||
29 | |||
30 | try { |
||
31 | $event = $this->activityManager->generateEvent(); |
||
32 | $event->setApp('mood'); |
||
33 | $event->setType('mood'); |
||
34 | $event->setAffectedUser($userId); |
||
35 | $event->setAuthor($frame->getAuthor()); |
||
36 | $event->setSubject('mood_item', ['share' => json_encode($frame)]); |
||
37 | |||
38 | $this->activityManager->publish($event); |
||
39 | |||
40 | return true; |
||
41 | } catch (\Exception $e) { |
||
42 | return false; |
||
43 | } |
||
44 | } |
||
45 | |||
85 | } |