new: [workflow-module:publish-event] Added draft of module

feature/workflow-module/publish-event
Sami Mokaddem 2023-10-17 21:17:08 +02:00
parent 082bda3ae3
commit b3591aeefd
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
<?php
include_once APP . 'Model/WorkflowModules/action/Module_webhook.php';
class Module_publish_event extends Module_webhook
{
public $id = 'publish-event';
public $name = 'Publish Event';
public $version = '0.1';
public $description = 'Publish an Event in the context of the workflow';
public $icon_path = 'upload';
private $Event;
public function __construct()
{
parent::__construct();
$this->Event = ClassRegistry::init('Event');
$this->params = [
];
}
public function exec(array $node, WorkflowRoamingData $roamingData, array &$errors = []): bool
{
$result = $this->Event->publish($event_id, null);
return $result === true;
}
}