Move webhook to project notification type

This commit is contained in:
Frederic Guillot
2015-10-17 12:30:05 -04:00
parent 3543f45c2d
commit 472f94efee
18 changed files with 311 additions and 129 deletions

View File

@@ -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);
}
}
}