seeddms-code/inc/inc.ClassNotificationService.php
2016-03-09 17:57:38 +01:00

57 lines
1.4 KiB
PHP

<?php
/**
* Implementation of notification service
*
* @category DMS
* @package SeedDMS
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2016 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Implementation of notification service
*
* @category DMS
* @package SeedDMS
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2016 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_NotificationService {
/**
* List of services for sending notification
*/
protected $services;
public function __construct() {
$this->services = array();
}
public function addService($service) {
$this->services[] = $service;
}
public function toIndividual($sender, $recipient, $subject, $message, $params=array()) {
foreach($this->services as $service) {
$service->toIndividual($sender, $recipient, $subject, $message, $params);
}
}
public function toGroup($sender, $groupRecipient, $subject, $message, $params=array()) {
foreach($this->services as $service) {
$service->toGroup($sender, $groupRecipient, $subject, $message, $params);
}
}
public function toList($sender, $recipients, $subject, $message, $params=array()) {
foreach($this->services as $service) {
$service->toList($sender, $recipients, $subject, $message, $params);
}
}
}