diff options
Diffstat (limited to 'app/Model/ProjectNotification.php')
-rw-r--r-- | app/Model/ProjectNotification.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/Model/ProjectNotification.php b/app/Model/ProjectNotification.php new file mode 100644 index 00000000..49fcc61d --- /dev/null +++ b/app/Model/ProjectNotification.php @@ -0,0 +1,29 @@ +<?php + +namespace Kanboard\Model; + +/** + * Project Notification + * + * @package model + * @author Frederic Guillot + */ +class ProjectNotification extends Base +{ + /** + * Send notifications + * + * @access public + * @param integer $project_id + * @param string $event_name + * @param array $event_data + */ + public function sendNotifications($project_id, $event_name, array $event_data) + { + $project = $this->project->getById($project_id); + + foreach ($this->projectNotificationType->getSelectedTypes($project_id) as $type) { + $this->projectNotificationType->getType($type)->notifyProject($project, $event_name, $event_data); + } + } +} |