1 | <?php |
||
29 | class Step implements StepInterface |
||
30 | { |
||
31 | /** |
||
32 | * @ORM\Id() |
||
33 | * @ORM\Column(name="id", type="integer") |
||
34 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
35 | * |
||
36 | * @var integer |
||
37 | */ |
||
38 | protected $id; |
||
39 | |||
40 | /** |
||
41 | * @ORM\Column(name="action_Id", type="integer", nullable=true) |
||
42 | * |
||
43 | * @var integer |
||
44 | */ |
||
45 | protected $actionId; |
||
46 | |||
47 | /** |
||
48 | * @ORM\Column(name="caller", type="string", length=35, nullable=true) |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $caller; |
||
53 | |||
54 | /** |
||
55 | * @ORM\Column(name="finish_date", type="datetime", nullable=true) |
||
56 | * |
||
57 | * @var DateTime |
||
58 | */ |
||
59 | protected $finishDate; |
||
60 | |||
61 | /** |
||
62 | * @ORM\Column(name="start_date", type="datetime") |
||
63 | * |
||
64 | * @var DateTime |
||
65 | */ |
||
66 | protected $startDate; |
||
67 | |||
68 | /** |
||
69 | * @ORM\Column(name="due_date", type="datetime", nullable=true) |
||
70 | * |
||
71 | * @var DateTime |
||
72 | */ |
||
73 | protected $dueDate; |
||
74 | |||
75 | /** |
||
76 | * @ORM\Column(name="owner", type="string", length=35, nullable=true) |
||
77 | * |
||
78 | * @var string |
||
79 | */ |
||
80 | protected $owner; |
||
81 | |||
82 | /** |
||
83 | * @ORM\Column(name="status", type="string", length=40, nullable=true) |
||
84 | * |
||
85 | * @var string |
||
86 | */ |
||
87 | protected $status; |
||
88 | |||
89 | /** |
||
90 | * @ORM\Column(name="step_id", type="integer") |
||
91 | * |
||
92 | * @var integer |
||
93 | */ |
||
94 | protected $stepId; |
||
95 | |||
96 | /** |
||
97 | * |
||
98 | * @ORM\ManyToMany(targetEntity="Step") |
||
99 | * @ORM\JoinTable( |
||
100 | * name="wf_previous_step", |
||
101 | * joinColumns={@ORM\JoinColumn(name="current_step_id", referencedColumnName="id")}, |
||
102 | * inverseJoinColumns={@ORM\JoinColumn(name="previous_step_id", referencedColumnName="id")} |
||
103 | * ) |
||
104 | * |
||
105 | * @var ArrayCollection|StepInterface[] |
||
106 | */ |
||
107 | protected $previousSteps; |
||
108 | |||
109 | /** |
||
110 | * Определяет тип шага |
||
111 | * |
||
112 | * @ORM\Column(name="type", type="string", length=15, nullable=false) |
||
113 | * |
||
114 | * @var string |
||
115 | */ |
||
116 | protected $type; |
||
117 | |||
118 | /** |
||
119 | * @ORM\ManyToOne(targetEntity="AbstractEntry", inversedBy="steps") |
||
120 | * @ORM\JoinColumn(name="entry_id", referencedColumnName="id") |
||
121 | * |
||
122 | * @var EntryInterface |
||
123 | */ |
||
124 | protected $entry; |
||
125 | |||
126 | /** |
||
127 | * Разрешенные типы шагов |
||
128 | * |
||
129 | * @var array |
||
130 | */ |
||
131 | protected $accessType = [ |
||
132 | self::CURRENT_STEP => self::CURRENT_STEP, |
||
133 | self::HISTORY_STEP => self::HISTORY_STEP, |
||
134 | ]; |
||
135 | |||
136 | /** |
||
137 | * |
||
138 | */ |
||
139 | public function __construct() |
||
143 | |||
144 | |||
145 | /** |
||
146 | * @return string |
||
147 | */ |
||
148 | public function getId() |
||
152 | |||
153 | /** |
||
154 | * @param string $id |
||
155 | * |
||
156 | * @return $this |
||
157 | */ |
||
158 | public function setId($id) |
||
164 | |||
165 | /** |
||
166 | * @return integer |
||
167 | */ |
||
168 | public function getActionId() |
||
172 | |||
173 | /** |
||
174 | * @param integer $actionId |
||
175 | * |
||
176 | * @return $this |
||
177 | */ |
||
178 | public function setActionId($actionId = null) |
||
184 | |||
185 | /** |
||
186 | * @return string |
||
187 | */ |
||
188 | public function getCaller() |
||
192 | |||
193 | /** |
||
194 | * @param string $caller |
||
195 | * |
||
196 | * @return $this |
||
197 | */ |
||
198 | public function setCaller($caller = null) |
||
204 | |||
205 | /** |
||
206 | * @return DateTime |
||
207 | */ |
||
208 | public function getFinishDate() |
||
212 | |||
213 | /** |
||
214 | * @param DateTime $finishDate |
||
215 | * |
||
216 | * @return $this |
||
217 | */ |
||
218 | public function setFinishDate(DateTime $finishDate = null) |
||
224 | |||
225 | /** |
||
226 | * @return DateTime |
||
227 | */ |
||
228 | public function getStartDate() |
||
232 | |||
233 | /** |
||
234 | * @param DateTime $startDate |
||
235 | * |
||
236 | * @return $this |
||
237 | */ |
||
238 | public function setStartDate(DateTime $startDate) |
||
244 | |||
245 | /** |
||
246 | * @return DateTime |
||
247 | */ |
||
248 | public function getDueDate() |
||
252 | |||
253 | /** |
||
254 | * @param DateTime $dueDate |
||
255 | * |
||
256 | * @return $this |
||
257 | */ |
||
258 | public function setDueDate(DateTime $dueDate = null) |
||
264 | |||
265 | /** |
||
266 | * @return string |
||
267 | */ |
||
268 | public function getOwner() |
||
272 | |||
273 | /** |
||
274 | * @param string $owner |
||
275 | * |
||
276 | * @return $this |
||
277 | */ |
||
278 | public function setOwner($owner) |
||
284 | |||
285 | /** |
||
286 | * @return string |
||
287 | */ |
||
288 | public function getStatus() |
||
292 | |||
293 | /** |
||
294 | * @param string $status |
||
295 | * |
||
296 | * @return $this |
||
297 | */ |
||
298 | public function setStatus($status) |
||
304 | |||
305 | /** |
||
306 | * @return string |
||
307 | */ |
||
308 | public function getStepId() |
||
312 | |||
313 | /** |
||
314 | * @param string $stepId |
||
315 | * |
||
316 | * @return $this |
||
317 | */ |
||
318 | public function setStepId($stepId) |
||
324 | |||
325 | /** |
||
326 | * Возвращает id процесса |
||
327 | * |
||
328 | * @return integer |
||
329 | */ |
||
330 | public function getEntryId() |
||
334 | |||
335 | /** |
||
336 | * Возвращает id предыдущхи шагов |
||
337 | * |
||
338 | */ |
||
339 | public function getPreviousStepIds() |
||
351 | |||
352 | /** |
||
353 | * @return ArrayCollection|StepInterface[] |
||
354 | */ |
||
355 | public function getPreviousSteps() |
||
359 | |||
360 | /** |
||
361 | * @param ArrayCollection|StepInterface[] $previousSteps |
||
362 | * |
||
363 | * @return $this |
||
364 | * |
||
365 | * @throws Exception\InvalidArgumentException |
||
366 | */ |
||
367 | public function setPreviousSteps($previousSteps) |
||
385 | |||
386 | /** |
||
387 | * Возвращает тип шага |
||
388 | * |
||
389 | * @return string |
||
390 | */ |
||
391 | public function getType() |
||
395 | |||
396 | /** |
||
397 | * Устанавливает тип шага |
||
398 | * |
||
399 | * @param string $type |
||
400 | * |
||
401 | * @return $this |
||
402 | * |
||
403 | * @throws Exception\InvalidArgumentException |
||
404 | */ |
||
405 | public function setType($type) |
||
415 | |||
416 | /** |
||
417 | * @return EntryInterface |
||
418 | */ |
||
419 | public function getEntry() |
||
423 | |||
424 | /** |
||
425 | * @param EntryInterface $entry |
||
426 | * |
||
427 | * @return $this |
||
428 | */ |
||
429 | public function setEntry(EntryInterface $entry) |
||
439 | } |
||
440 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.