Files
piratepoet/mailpoet/lib/Automation/Engine/Control/ActionScheduler.php
Jan Jakes fc16bacadc Add "core" automation integration & implement wait action
The "core" integration will provide triggers, actions, and subjects
that are not specific to any 3rd party integration.

[MAILPOET-4136]
2022-03-14 09:36:21 +01:00

20 lines
608 B
PHP

<?php declare(strict_types = 1);
namespace MailPoet\Automation\Engine\Control;
class ActionScheduler {
private const GROUP_ID = 'mailpoet-automation';
public function enqueue(string $hook, array $args = []): int {
return as_enqueue_async_action($hook, $args, self::GROUP_ID);
}
public function schedule(int $timestamp, string $hook, array $args = []): int {
return as_schedule_single_action($timestamp, $hook, $args, self::GROUP_ID);
}
public function hasScheduledAction(string $hook, array $args = []): bool {
return as_has_scheduled_action($hook, $args, self::GROUP_ID);
}
}