1 | <?php |
||
7 | abstract class Task implements TaskInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $expression; |
||
13 | |||
14 | /** |
||
15 | * @var null|string|array |
||
16 | */ |
||
17 | protected $output; |
||
18 | |||
19 | /** |
||
20 | * @return mixed |
||
21 | */ |
||
22 | abstract public function run(); |
||
23 | |||
24 | /** |
||
25 | * Sets a cron expression |
||
26 | * @param string $expression |
||
27 | * @return Task $this |
||
28 | */ |
||
29 | public function setExpression($expression) |
||
34 | |||
35 | /** |
||
36 | * Gets the current cron expression |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getExpression() |
||
43 | |||
44 | /** |
||
45 | * Sets the output from the task |
||
46 | * @param null|string|array $output |
||
47 | * @return Task $this |
||
48 | */ |
||
49 | public function setOutput($output) |
||
54 | |||
55 | /** |
||
56 | * Gets the output from the task |
||
57 | * @return null|string|array |
||
58 | */ |
||
59 | public function getOutput() |
||
63 | |||
64 | /** |
||
65 | * Checks whether the task is currently due |
||
66 | * @return bool |
||
67 | */ |
||
68 | public function isDue() |
||
78 | |||
79 | } |