public function PushNotificationsMessageSenderBase::setNetworks in Push Notifications 8
Setter functions for networks.
Parameters
array $networks: Target networks.
Throws
\Exception Passed networks need to be array and valid networks.
File
- src/
PushNotificationsMessageSenderBase.php, line 60 - Contains \Drupal\push_notifications\PushNotificationsMessageSenderBase.
Class
- PushNotificationsMessageSenderBase
- Handles sending of alerts.
Namespace
Drupal\push_notificationsCode
public function setNetworks($networks) {
// Validate networks.
$valid_networks = push_notifications_get_networks();
if (empty($networks) || !empty(array_diff($networks, $valid_networks))) {
throw new \Exception('Passed networks are invalid.');
}
$this->networks = $networks;
}