-
Notifications
You must be signed in to change notification settings - Fork 451
/
ProcessOutputEvent.php
46 lines (35 loc) · 992 Bytes
/
ProcessOutputEvent.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Concrete\Core\Notification\Events\ServerEvent;
use Concrete\Core\Notification\Events\Topic\ConcreteProcessTopic;
use Concrete\Core\Notification\Events\Topic\TopicInterface;
class ProcessOutputEvent extends AbstractConcreteEvent implements SubscribableEventInterface
{
/**
* @var string
*/
protected $processId;
/**
* @var string
*/
protected $message;
public function __construct(string $processId, string $message)
{
$this->processId = $processId;
$this->message = $message;
}
public function createTopic(): TopicInterface
{
return static::getTopicForSubscribing();
}
public static function getTopicForSubscribing(): TopicInterface
{
return new ConcreteProcessTopic('/process_output');
}
protected function getEventData(): array
{
return [
'processId' => $this->processId,
'message' => $this->message
];
}
}