nextcloud/lib/unstable/WorkflowEngine/RuntimeOperation.php
Salvatore Martire 2a9036a5b7 feat(wfe): add runtime operations
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>

# Conflicts:
#	apps/workflowengine/lib/Manager.php
2026-05-18 12:23:49 +02:00

63 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace NCU\WorkflowEngine;
use OCP\WorkflowEngine\IEntity;
use OCP\WorkflowEngine\IOperation;
/**
* @experimental 34.0.0
*/
final readonly class RuntimeOperation {
private bool $runtime;
/**
* @experimental 34.0.0
*
* @param string $id
* @param class-string<IOperation> $class
* @param string $name
* @param list<string> $checks
* @param string $operation
* @param class-string<IEntity> $entity
* @param list<string> $events
* @param string $appId
*/
public function __construct(
public string $id,
public string $class,
public string $name,
public array $checks,
public string $operation,
public string $entity,
public array $events,
public string $appId,
) {
$this->runtime = true;
}
/**
* @experimental 34.0.0
* @return array<key-of<properties-of<self>>, value-of<properties-of<self>>>
*/
public function toArray(): array {
return [
'id' => $this->id,
'class' => $this->class,
'name' => $this->name,
'checks' => $this->checks,
'operation' => $this->operation,
'entity' => $this->entity,
'events' => $this->events,
'appId' => $this->appId,
'runtime' => $this->runtime,
];
}
}