1 | <?php namespace Comodojo\Extender\Orm\Entities; |
||
29 | class Schedule { |
||
30 | |||
31 | use BaseEntityTrait; |
||
32 | use RequestEntityTrait; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | * |
||
37 | * @ORM\Column(name="name", type="string", length=256, nullable=false, unique=true) |
||
38 | */ |
||
39 | protected $name; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | * |
||
44 | * @ORM\Column(name="description", type="text", length=65535, nullable=true) |
||
45 | */ |
||
46 | protected $description; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | * |
||
51 | * @ORM\Column(name="minute", type="string", length=16, nullable=false) |
||
52 | */ |
||
53 | protected $minute; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | * |
||
58 | * @ORM\Column(name="hour", type="string", length=16, nullable=false) |
||
59 | */ |
||
60 | protected $hour; |
||
61 | |||
62 | /** |
||
63 | * @var string |
||
64 | * |
||
65 | * @ORM\Column(name="day", type="string", length=16, nullable=false) |
||
66 | */ |
||
67 | protected $day; |
||
68 | |||
69 | /** |
||
70 | * @var string |
||
71 | * |
||
72 | * @ORM\Column(name="month", type="string", length=16, nullable=false) |
||
73 | */ |
||
74 | protected $month; |
||
75 | |||
76 | /** |
||
77 | * @var string |
||
78 | * |
||
79 | * @ORM\Column(name="weekday", type="string", length=16, nullable=false) |
||
80 | */ |
||
81 | protected $weekday; |
||
82 | |||
83 | /** |
||
84 | * @var string |
||
85 | * |
||
86 | * @ORM\Column(name="year", type="string", length=16, nullable=true) |
||
87 | */ |
||
88 | protected $year; |
||
89 | |||
90 | /** |
||
91 | * @var boolean |
||
92 | * |
||
93 | * @ORM\Column(name="enabled", type="boolean", nullable=false) |
||
94 | */ |
||
95 | protected $enabled = false; |
||
96 | |||
97 | /** |
||
98 | * @var datetime |
||
99 | * |
||
100 | * @ORM\Column(name="firstrun", type="datetime", nullable=true) |
||
101 | */ |
||
102 | protected $firstrun; |
||
103 | |||
104 | /** |
||
105 | * @var datetime |
||
106 | * |
||
107 | * @ORM\Column(name="lastrun", type="datetime", nullable=true) |
||
108 | */ |
||
109 | protected $lastrun; |
||
110 | |||
111 | /** |
||
112 | * Get a brief job description |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | public function getDescription() { |
||
121 | |||
122 | /** |
||
123 | * Set brief job description |
||
124 | * |
||
125 | * @param string $description |
||
126 | * @return Schedule |
||
127 | */ |
||
128 | public function setDescription($description) { |
||
135 | |||
136 | /** |
||
137 | * Get cron expression of this schedule |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | public function getExpression() { |
||
146 | |||
147 | /** |
||
148 | * set cron expression for this schedule |
||
149 | * |
||
150 | * @param srting $expression A cron-compatible expression |
||
151 | * @return Schedule |
||
152 | */ |
||
153 | public function setExpression(CronExpression $expression) { |
||
165 | |||
166 | /** |
||
167 | * True if job is currently enabled |
||
168 | * |
||
169 | * @return bool |
||
170 | */ |
||
171 | public function getEnabled() { |
||
176 | |||
177 | /** |
||
178 | * Set enable/disable status |
||
179 | * |
||
180 | * @param bool $enable |
||
|
|||
181 | * @return Schedule |
||
182 | */ |
||
183 | public function setEnabled($enabled) { |
||
184 | |||
185 | $ena = DataFilter::filterBoolean($enabled); |
||
186 | |||
187 | $this->enabled = $ena; |
||
188 | |||
189 | return $this; |
||
190 | |||
191 | } |
||
192 | |||
193 | /** |
||
194 | * Get the first-run-date of job |
||
195 | * |
||
196 | * @return DateTime |
||
197 | */ |
||
198 | public function getFirstrun() { |
||
203 | |||
204 | /** |
||
205 | * Set the first-run-date of job |
||
206 | * |
||
207 | * @param DateTime $datetime |
||
208 | * @return Schedule |
||
209 | */ |
||
210 | public function setFirstrun(DateTime $datetime) { |
||
217 | |||
218 | /** |
||
219 | * Get the first-run-date of job |
||
220 | * |
||
221 | * @return DateTime |
||
222 | */ |
||
223 | public function getLastrun() { |
||
228 | |||
229 | /** |
||
230 | * Set the first-run-date of job |
||
231 | * |
||
232 | * @param DateTime $datetime |
||
233 | * @return Schedule |
||
234 | */ |
||
235 | public function setLastrun(DateTime $datetime) { |
||
242 | |||
243 | public function shouldRunJob(DateTime $time) { |
||
255 | |||
256 | public function getNextPlannedRun(DateTime $time) { |
||
272 | |||
273 | public function merge(Schedule $schedule) { |
||
283 | |||
284 | protected function buildExpression() { |
||
298 | } |
||
299 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.