Add basic workflow step saving to workflow update API

[MAILPOET-4420]
This commit is contained in:
Jan Jakes
2022-07-15 14:40:10 +02:00
committed by Veljko V
parent 55fb3f6c82
commit 7da2d2f7c8
4 changed files with 58 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ class Exceptions {
private const SUBJECT_NOT_FOUND = 'mailpoet_automation_subject_not_found';
private const SUBJECT_LOAD_FAILED = 'mailpoet_automation_workflow_subject_load_failed';
private const MULTIPLE_SUBJECTS_FOUND = 'mailpoet_automation_multiple_subjects_found';
private const WORKFLOW_STRUCTURE_MODIFICATION_NOT_SUPPORTED = 'mailpoet_automation_workflow_structure_modification_not_supported';
public function __construct() {
throw new InvalidStateException(
@@ -112,4 +113,10 @@ class Exceptions {
->withErrorCode(self::MULTIPLE_SUBJECTS_FOUND)
->withMessage(__(sprintf("Multiple subjects with key '%s' found, only one expected.", $key), 'mailpoet'));
}
public static function workflowStructureModificationNotSupported(): UnexpectedValueException {
return UnexpectedValueException::create()
->withErrorCode(self::WORKFLOW_STRUCTURE_MODIFICATION_NOT_SUPPORTED)
->withMessage(__("Workflow structure modification not supported.", 'mailpoet'));
}
}