2026-03-04 15:56:58 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Service\Scheduler;
|
|
|
|
|
|
|
|
|
|
use MintyPHP\Repository\Scheduler\ScheduledJobRepository;
|
2026-03-05 08:26:51 +01:00
|
|
|
use MintyPHP\Repository\Scheduler\ScheduledJobRepositoryInterface;
|
2026-03-04 15:56:58 +01:00
|
|
|
use MintyPHP\Repository\Scheduler\ScheduledJobRunRepository;
|
2026-03-05 08:26:51 +01:00
|
|
|
use MintyPHP\Repository\Scheduler\ScheduledJobRunRepositoryInterface;
|
2026-03-04 15:56:58 +01:00
|
|
|
use MintyPHP\Repository\Scheduler\SchedulerRuntimeRepository;
|
2026-03-05 08:26:51 +01:00
|
|
|
use MintyPHP\Repository\Scheduler\SchedulerRuntimeRepositoryInterface;
|
2026-03-04 15:56:58 +01:00
|
|
|
|
|
|
|
|
class SchedulerRepositoryFactory
|
|
|
|
|
{
|
|
|
|
|
private ?ScheduledJobRepository $scheduledJobRepository = null;
|
|
|
|
|
private ?ScheduledJobRunRepository $scheduledJobRunRepository = null;
|
|
|
|
|
private ?SchedulerRuntimeRepository $schedulerRuntimeRepository = null;
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
public function createScheduledJobRepository(): ScheduledJobRepositoryInterface
|
2026-03-04 15:56:58 +01:00
|
|
|
{
|
|
|
|
|
return $this->scheduledJobRepository ??= new ScheduledJobRepository();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
public function createScheduledJobRunRepository(): ScheduledJobRunRepositoryInterface
|
2026-03-04 15:56:58 +01:00
|
|
|
{
|
|
|
|
|
return $this->scheduledJobRunRepository ??= new ScheduledJobRunRepository();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
public function createSchedulerRuntimeRepository(): SchedulerRuntimeRepositoryInterface
|
2026-03-04 15:56:58 +01:00
|
|
|
{
|
|
|
|
|
return $this->schedulerRuntimeRepository ??= new SchedulerRuntimeRepository();
|
|
|
|
|
}
|
|
|
|
|
}
|