|
|
<?php |
|
|
|
|
|
namespace Kanboard\Job; |
|
|
|
|
|
use Kanboard\EventBuilder\SubtaskEventBuilder; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SubtaskEventJob extends BaseJob |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function withParams($subtaskId, array $eventNames, array $values = array()) |
|
|
{ |
|
|
$this->jobParams = array($subtaskId, $eventNames, $values); |
|
|
return $this; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function execute($subtaskId, array $eventNames, array $values = array()) |
|
|
{ |
|
|
$event = SubtaskEventBuilder::getInstance($this->container) |
|
|
->withSubtaskId($subtaskId) |
|
|
->withValues($values) |
|
|
->buildEvent(); |
|
|
|
|
|
if ($event !== null) { |
|
|
foreach ($eventNames as $eventName) { |
|
|
$this->dispatcher->dispatch($event, $eventName); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|