|
|
<?php |
|
|
|
|
|
namespace Kanboard\Job; |
|
|
|
|
|
use Kanboard\Event\GenericEvent; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NotificationJob extends BaseJob |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function withParams(GenericEvent $event, $eventName) |
|
|
{ |
|
|
$this->jobParams = array($event->getAll(), $eventName); |
|
|
return $this; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function execute(array $eventData, $eventName) |
|
|
{ |
|
|
if (! empty($eventData['mention'])) { |
|
|
$this->userNotificationModel->sendUserNotification($eventData['mention'], $eventName, $eventData); |
|
|
} else { |
|
|
$this->userNotificationModel->sendNotifications($eventName, $eventData); |
|
|
$this->projectNotificationModel->sendNotifications($eventData['task']['project_id'], $eventName, $eventData); |
|
|
} |
|
|
} |
|
|
} |
|
|
|