Add trash status to Workflow
[MAILPOET-4417]
This commit is contained in:
@ -67,7 +67,7 @@ class UpdateWorkflowController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function checkWorkflowStatus(string $status): void {
|
private function checkWorkflowStatus(string $status): void {
|
||||||
if (!in_array($status, [Workflow::STATUS_ACTIVE, Workflow::STATUS_INACTIVE, Workflow::STATUS_DRAFT], true)) {
|
if (!in_array($status, Workflow::STATUS_ALL, true)) {
|
||||||
// translators: %s is the status.
|
// translators: %s is the status.
|
||||||
throw UnexpectedValueException::create()->withMessage(sprintf(__('Invalid status: %s', 'mailpoet'), $status));
|
throw UnexpectedValueException::create()->withMessage(sprintf(__('Invalid status: %s', 'mailpoet'), $status));
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,13 @@ class Workflow {
|
|||||||
public const STATUS_ACTIVE = 'active';
|
public const STATUS_ACTIVE = 'active';
|
||||||
public const STATUS_INACTIVE = 'inactive';
|
public const STATUS_INACTIVE = 'inactive';
|
||||||
public const STATUS_DRAFT = 'draft';
|
public const STATUS_DRAFT = 'draft';
|
||||||
|
public const STATUS_TRASH = 'trash';
|
||||||
|
public const STATUS_ALL = [
|
||||||
|
self::STATUS_ACTIVE,
|
||||||
|
self::STATUS_INACTIVE,
|
||||||
|
self::STATUS_DRAFT,
|
||||||
|
self::STATUS_TRASH,
|
||||||
|
];
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
private $id;
|
private $id;
|
||||||
|
Reference in New Issue
Block a user