1 | <?php |
||
7 | class CreateJobCommand extends JobCommand |
||
8 | { |
||
9 | /** |
||
10 | * Determines if command can run. |
||
11 | * |
||
12 | * @return bool |
||
13 | */ |
||
14 | public function runnable() |
||
25 | |||
26 | /** |
||
27 | * Set job command. |
||
28 | * |
||
29 | * @param string $command |
||
30 | * |
||
31 | * @return static |
||
32 | */ |
||
33 | public function schedule(string $command) |
||
37 | |||
38 | /** |
||
39 | * Set job user. |
||
40 | * |
||
41 | * @param string $user |
||
42 | * |
||
43 | * @return static |
||
44 | */ |
||
45 | public function runningAs(string $user) |
||
46 | { |
||
47 | return $this->attachPayload('user', $user); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Indicates that job should run every minute. |
||
52 | * |
||
53 | * @return static |
||
54 | */ |
||
55 | public function everyMinute() |
||
59 | |||
60 | /** |
||
61 | * Indicates that job should run every hour. |
||
62 | * |
||
63 | * @return static |
||
64 | */ |
||
65 | public function hourly() |
||
69 | |||
70 | /** |
||
71 | * Indicates that job should run every day at midnight. |
||
72 | * |
||
73 | * @return static |
||
74 | */ |
||
75 | public function nightly() |
||
79 | |||
80 | /** |
||
81 | * Indicates that job should run every week. |
||
82 | * |
||
83 | * @return static |
||
84 | */ |
||
85 | public function weekly() |
||
89 | |||
90 | /** |
||
91 | * Indicates that job should run every month. |
||
92 | * |
||
93 | * @return static |
||
94 | */ |
||
95 | public function monthly() |
||
99 | |||
100 | /** |
||
101 | * Schedule job at hour:minute. |
||
102 | * |
||
103 | * @param string $time |
||
104 | * |
||
105 | * @throws \InvalidArgumentException |
||
106 | * |
||
107 | * @return static |
||
108 | */ |
||
109 | public function atTime(string $time) |
||
123 | |||
124 | /** |
||
125 | * Schedule job at given day. |
||
126 | * |
||
127 | * @param string|int $day |
||
128 | * |
||
129 | * @return static |
||
130 | */ |
||
131 | public function atDay($day) |
||
136 | |||
137 | /** |
||
138 | * Schedule job at given month. |
||
139 | * |
||
140 | * @param string|int $month |
||
141 | * |
||
142 | * @return static |
||
143 | */ |
||
144 | public function atMonth($month) |
||
149 | |||
150 | /** |
||
151 | * Schedule job at given weekday. |
||
152 | * |
||
153 | * @param string|int $weekday |
||
154 | * |
||
155 | * @return static |
||
156 | */ |
||
157 | public function atWeekday($weekday) |
||
162 | } |
||
163 |