Elgg  Version master
InstantNotificationEventHandler.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Notifications;
4 
11 
15  public function getSubscriptions(): array {
16  $subscriptions = [];
17 
18  $methods_override = (array) elgg_extract('methods_override', $this->params, []);
19  $recipients = (array) elgg_extract('recipients', $this->params, []);
20 
21  foreach ($recipients as $user) {
22  if (!empty($methods_override)) {
23  $subscriptions[$user->guid] = $methods_override;
24  continue;
25  }
26 
27  // get user default preferences
28  $subscriptions[$user->guid] = array_keys(array_filter($user->getNotificationSettings()));
29  }
30 
31  return $subscriptions;
32  }
33 
37  protected function addMuteLink(): bool {
38  return false;
39  }
40 }
Notification Event Handler for instant notifications.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
Notification Event Handler handles preparation of a notification.
$user
Definition: ban.php:7
if(empty($methods)) $subscriptions