Added internal task links to activity stream
This commit is contained in:
45
app/Job/TaskLinkEventJob.php
Normal file
45
app/Job/TaskLinkEventJob.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Job;
|
||||
|
||||
use Kanboard\EventBuilder\TaskLinkEventBuilder;
|
||||
|
||||
/**
|
||||
* Class TaskLinkEventJob
|
||||
*
|
||||
* @package Kanboard\Job
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class TaskLinkEventJob extends BaseJob
|
||||
{
|
||||
/**
|
||||
* Set job params
|
||||
*
|
||||
* @param int $taskLinkId
|
||||
* @param string $eventName
|
||||
* @return $this
|
||||
*/
|
||||
public function withParams($taskLinkId, $eventName)
|
||||
{
|
||||
$this->jobParams = array($taskLinkId, $eventName);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute job
|
||||
*
|
||||
* @param int $taskLinkId
|
||||
* @param string $eventName
|
||||
* @return $this
|
||||
*/
|
||||
public function execute($taskLinkId, $eventName)
|
||||
{
|
||||
$event = TaskLinkEventBuilder::getInstance($this->container)
|
||||
->withTaskLinkId($taskLinkId)
|
||||
->build();
|
||||
|
||||
if ($event !== null) {
|
||||
$this->dispatcher->dispatch($eventName, $event);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user