1 | <?php |
||
15 | class Scheduler implements SchedulerInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var JobInterface[] |
||
19 | */ |
||
20 | protected $jobs = []; |
||
21 | |||
22 | /** |
||
23 | * Scheduler constructor. |
||
24 | * @param JobInterface[] $jobs |
||
25 | */ |
||
26 | 12 | public function __construct(array $jobs = []) |
|
32 | |||
33 | /** |
||
34 | * @inheritdoc |
||
35 | */ |
||
36 | 12 | public function getIterator(DateTimeInterface $from, DateTimeInterface $to = null, $inc = true) |
|
48 | |||
49 | /** |
||
50 | * @param JobInterface $job |
||
51 | * @return mixed|void |
||
52 | */ |
||
53 | 12 | public function addJob(JobInterface $job) |
|
57 | |||
58 | /** |
||
59 | * @param \ArrayIterator $iterator - iterator to append actions |
||
60 | * @param JobInterface $job |
||
61 | * @param DateTimeInterface $from |
||
62 | * @param DateTimeInterface $to |
||
63 | * @param $inc |
||
64 | */ |
||
65 | 12 | protected function appendActions(\ArrayIterator $iterator, JobInterface $job, DateTimeInterface $from, DateTimeInterface $to, $inc) |
|
72 | |||
73 | /** |
||
74 | * Sort actions by execution time |
||
75 | * @param \ArrayIterator $iterator - iterator to append actions |
||
76 | */ |
||
77 | protected function sortActions(\ArrayIterator $iterator) |
||
86 | } |