ActionScheduler.php
3 weeks ago
AutomationController.php
2 years ago
FilterHandler.php
1 month ago
RootStep.php
2 years ago
StepHandler.php
2 months ago
StepRunController.php
1 year ago
StepRunControllerFactory.php
1 year ago
StepRunLogger.php
2 months ago
StepRunLoggerFactory.php
2 years ago
StepScheduler.php
1 year ago
SubjectLoader.php
3 years ago
SubjectTransformerHandler.php
1 year ago
TriggerHandler.php
2 years ago
index.php
3 years ago
StepRunController.php
51 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\Automation\Engine\Control; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\Automation\Engine\Control\StepRunLogger; |
| 9 | use MailPoet\Automation\Engine\Data\StepRunArgs; |
| 10 | |
| 11 | class StepRunController { |
| 12 | /** @var StepScheduler */ |
| 13 | private $stepScheduler; |
| 14 | |
| 15 | /** @var StepRunArgs */ |
| 16 | private $stepRunArgs; |
| 17 | |
| 18 | /** @var StepRunLogger */ |
| 19 | private $stepRunLogger; |
| 20 | |
| 21 | public function __construct( |
| 22 | StepScheduler $stepScheduler, |
| 23 | StepRunArgs $stepRunArgs, |
| 24 | StepRunLogger $stepRunLogger |
| 25 | ) { |
| 26 | $this->stepScheduler = $stepScheduler; |
| 27 | $this->stepRunArgs = $stepRunArgs; |
| 28 | $this->stepRunLogger = $stepRunLogger; |
| 29 | } |
| 30 | |
| 31 | public function scheduleProgress(?int $timestamp = null): int { |
| 32 | return $this->stepScheduler->scheduleProgress($this->stepRunArgs, $timestamp); |
| 33 | } |
| 34 | |
| 35 | public function scheduleNextStep(?int $timestamp = null): int { |
| 36 | return $this->stepScheduler->scheduleNextStep($this->stepRunArgs, $timestamp); |
| 37 | } |
| 38 | |
| 39 | public function scheduleNextStepByIndex(int $nextStepIndex, ?int $timestamp = null): int { |
| 40 | return $this->stepScheduler->scheduleNextStepByIndex($this->stepRunArgs, $nextStepIndex, $timestamp); |
| 41 | } |
| 42 | |
| 43 | public function hasScheduledNextStep(): bool { |
| 44 | return $this->stepScheduler->hasScheduledNextStep($this->stepRunArgs); |
| 45 | } |
| 46 | |
| 47 | public function getRunLog(): StepRunLogger { |
| 48 | return $this->stepRunLogger; |
| 49 | } |
| 50 | } |
| 51 |