| Conditions | 3 |
| Paths | 3 |
| Total Lines | 28 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function hookItemVisibility(HookPortfolioItemVisibilityEventInterface $event) |
||
| 16 | { |
||
| 17 | /** @var Portfolio $item */ |
||
| 18 | $item = $event->getEventData()['item']; |
||
| 19 | $recipients = $event->getEventData()['recipients']; |
||
| 20 | |||
| 21 | try { |
||
| 22 | $json = $this->doVisibilityRequest( |
||
| 23 | [ |
||
| 24 | 'content_id' => $item->getId(), |
||
| 25 | 'content_type' => 'eportfolio', |
||
| 26 | 'visibility' => $item->getVisibility(), |
||
| 27 | 'user_list' => $recipients, |
||
| 28 | ] |
||
| 29 | ); |
||
| 30 | } catch (Exception $e) { |
||
| 31 | Display::addFlash( |
||
| 32 | Display::return_message($e->getMessage(), 'error') |
||
| 33 | ); |
||
| 34 | |||
| 35 | return; |
||
| 36 | } |
||
| 37 | |||
| 38 | if (empty($json)) { |
||
| 39 | return; |
||
| 40 | } |
||
| 41 | |||
| 42 | error_log('ExtNotifConn: Portfolio item visibility: ID '.$json['data']['notification_id']); |
||
| 43 | } |
||
| 45 |