/**
* Sends the notifications based on subscriptions
*
* Returns an array in the form:
* <code>
* [
* 25 => [
* 'email' => true,
* 'sms' => false,
* ],
* 55 => [],
* ]
* </code>
*
* @param NotificationEvent $event Notification event
* @param array $subscriptions Subscriptions for this event
* @param array $params Default notification parameters
* @return array
* @access private
*/
protected function sendNotifications($event, $subscriptions, array $params = [])
{
if (!$this->methods) {
return 0;
}
$result = [];
foreach ($subscriptions as $guid => $methods) {
foreach ($methods as $method) {
$result[$guid][$method] = false;
if (in_array($method, $this->methods)) {
$result[$guid][$method] = $this->sendNotification($event, $guid, $method, $params);
}
}
}
$this->logger->notice("Results for the notification event {$event->getDescription()}: " . print_r($result, true));
return $result;
}