ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilStudyProgrammeUserTableRow.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 protected PRGProgressId $id;
27 protected int $status_raw;
28 protected bool $active_raw;
29
30 protected string $active;
31 protected string $firstname;
32 protected string $lastname;
33 protected string $login;
34 protected string $orgus;
35 protected string $gender;
36 protected string $status;
37 protected string $completion_date;
41 protected ?array $completion_by_obj_ids;
42 protected string $completion_by;
43 protected string $points_reachable;
44 protected string $points_required;
45 protected string $points_current;
46 protected string $custom_plan;
47 protected string $belongs_to;
48 protected string $assign_date;
49 protected string $assigned_by;
50 protected string $deadline;
51 protected string $expiry_date;
52 protected string $validity;
53 protected string $restart_date;
54 protected int $lifecycle_status;
55 protected bool $cert_relevance;
56
57 public function __construct(
58 protected int $ass_id,
59 protected int $usr_id,
60 protected int $node_obj_id,
61 protected bool $is_root_progress,
62 protected ilPRGUserInformation $user_information
63 ) {
64 $this->id = new PRGProgressId($ass_id, $usr_id, $node_obj_id);
65 }
66
67 public function getId(): PRGProgressId
68 {
69 return $this->id;
70 }
71 public function getAssignmentId(): int
72 {
73 return $this->ass_id;
74 }
75 public function getUsrId(): int
76 {
77 return $this->usr_id;
78 }
79 public function getNodeId(): int
80 {
81 return $this->node_obj_id;
82 }
83 public function isRootProgress(): bool
84 {
85 return $this->is_root_progress;
86 }
87
89 {
90 return $this->user_information;
91 }
92 public function getUserData(string $field_id)
93 {
94 return $this->user_information->getUserData($field_id);
95 }
96
97 public function withUserActiveRaw(bool $active_raw): self
98 {
99 $clone = clone $this;
100 $clone->active_raw = $active_raw;
101 return $clone;
102 }
103 public function isUserActiveRaw(): bool
104 {
105 return $this->active_raw;
106 }
107 public function withUserActive(string $active): self
108 {
109 $clone = clone $this;
110 $clone->active = $active;
111 return $clone;
112 }
113 public function getUserActive(): string
114 {
115 return $this->active;
116 }
117
118 public function withFirstname(string $firstname): self
119 {
120 $clone = clone $this;
121 $clone->firstname = $firstname;
122 return $clone;
123 }
124 public function getFirstname(): string
125 {
126 return $this->firstname;
127 }
128
129 public function withLastname(string $lastname): self
130 {
131 $clone = clone $this;
132 $clone->lastname = $lastname;
133 return $clone;
134 }
135 public function getLastname(): string
136 {
137 return $this->lastname;
138 }
139
140 public function getName(): string
141 {
142 return $this->lastname . ', ' . $this->firstname;
143 }
144
145 public function withLogin(string $login): self
146 {
147 $clone = clone $this;
148 $clone->login = $login;
149 return $clone;
150 }
151 public function getLogin(): string
152 {
153 return $this->login;
154 }
155
156 public function withOrgUs(string $orgus): self
157 {
158 $clone = clone $this;
159 $clone->orgus = $orgus;
160 return $clone;
161 }
162 public function getOrgUs(): string
163 {
164 return $this->orgus;
165 }
166
167 public function withGender(string $gender): self
168 {
169 $clone = clone $this;
170 $clone->gender = $gender;
171 return $clone;
172 }
173 public function getGender(): string
174 {
175 return $this->gender;
176 }
177
178 public function withStatus(string $status): self
179 {
180 $clone = clone $this;
181 $clone->status = $status;
182 return $clone;
183 }
184 public function getStatus(): string
185 {
186 return $this->status;
187 }
188 public function withStatusRaw(int $status_raw): self
189 {
190 $clone = clone $this;
191 $clone->status_raw = $status_raw;
192 return $clone;
193 }
194 public function getStatusRaw(): int
195 {
196 return $this->status_raw;
197 }
198
199 public function withCompletionDate(string $completion_date): self
200 {
201 $clone = clone $this;
202 $clone->completion_date = $completion_date;
203 return $clone;
204 }
205 public function getCompletionDate(): string
206 {
208 }
209
210 public function withCompletionBy(string $completion_by): self
211 {
212 $clone = clone $this;
213 $clone->completion_by = $completion_by;
214 return $clone;
215 }
216 public function getCompletionBy(): string
217 {
219 }
220
224 public function withCompletionByObjIds(?array $obj_ids): self
225 {
226 $clone = clone $this;
227 $clone->completion_by_obj_ids = $obj_ids;
228 return $clone;
229 }
230
234 public function getCompletionByObjIds(): ?array
235 {
237 }
238
239 public function withPointsReachable(string $points_reachable): self
240 {
241 $clone = clone $this;
242 $clone->points_reachable = $points_reachable;
243 return $clone;
244 }
245 public function getPointsReachable(): string
246 {
248 }
249 public function withPointsRequired(string $points_required): self
250 {
251 $clone = clone $this;
252 $clone->points_required = $points_required;
253 return $clone;
254 }
255 public function getPointsRequired(): string
256 {
258 }
259 public function withPointsCurrent(string $points_current): self
260 {
261 $clone = clone $this;
262 $clone->points_current = $points_current;
263 return $clone;
264 }
265 public function getPointsCurrent(): string
266 {
268 }
269 public function withCustomPlan(string $custom_plan): self
270 {
271 $clone = clone $this;
272 $clone->custom_plan = $custom_plan;
273 return $clone;
274 }
275 public function getCustomPlan(): string
276 {
277 return $this->custom_plan;
278 }
279
280 public function withBelongsTo(string $belongs_to): self
281 {
282 $clone = clone $this;
283 $clone->belongs_to = $belongs_to;
284 return $clone;
285 }
286 public function getBelongsTo(): string
287 {
288 return $this->belongs_to;
289 }
290
291 public function withAssignmentDate(string $assign_date): self
292 {
293 $clone = clone $this;
294 $clone->assign_date = $assign_date;
295 return $clone;
296 }
297 public function getAssignmentDate(): string
298 {
299 return $this->assign_date;
300 }
301
302 public function withAssignmentBy(string $assigned_by): self
303 {
304 $clone = clone $this;
305 $clone->assigned_by = $assigned_by;
306 return $clone;
307 }
308 public function getAssignmentBy(): string
309 {
310 return $this->assigned_by;
311 }
312
313 public function withDeadline(string $deadline): self
314 {
315 $clone = clone $this;
316 $clone->deadline = $deadline;
317 return $clone;
318 }
319 public function getDeadline(): string
320 {
321 return $this->deadline;
322 }
323
324 public function withExpiryDate(string $expiry_date): self
325 {
326 $clone = clone $this;
327 $clone->expiry_date = $expiry_date;
328 return $clone;
329 }
330 public function getExpiryDate(): string
331 {
332 return $this->expiry_date;
333 }
334
335 public function withValidity(string $validity): self
336 {
337 $clone = clone $this;
338 $clone->validity = $validity;
339 return $clone;
340 }
341 public function getValidity(): string
342 {
343 return $this->validity;
344 }
345
346 public function withRestartDate(string $restart_date): self
347 {
348 $clone = clone $this;
349 $clone->restart_date = $restart_date;
350 return $clone;
351 }
352 public function getRestartDate(): string
353 {
354 return $this->restart_date;
355 }
356
358 {
360 throw new \LogicException('Invalid status: ' . $lifecycle_status);
361 }
362 $clone = clone $this;
363 $clone->lifecycle_status = $lifecycle_status;
364 return $clone;
365 }
366
367 public function getNodeLifecycleStatus(): int
368 {
370 }
371
372 public function withCertificateRelevance(bool $cert_relevance): self
373 {
374 $clone = clone $this;
375 $clone->cert_relevance = $cert_relevance;
376 return $clone;
377 }
378 public function getCertificateRelevance(): bool
379 {
381 }
382
383
384 public function toArray(): array
385 {
386 $ret = [
387 'prgrs_id' => (string) $this->getId(),
388 'name' => $this->getName(),
389 'active_raw' => $this->isUserActiveRaw(),
390 'active' => $this->getUserActive(),
391 'firstname' => $this->getFirstname(),
392 'lastname' => $this->getLastname(),
393 'login' => $this->getLogin(),
394 'orgus' => $this->getOrgUs(),
395 'gender' => $this->getGender(),
396 'status' => $this->getStatus(),
397 'completion_date' => $this->getCompletionDate(),
398 'completion_by' => $this->getCompletionBy(),
399 'points_reachable' => $this->getPointsReachable(),
400 'points_required' => $this->getPointsRequired(),
401 'points_current' => $this->getPointsCurrent(),
402 'custom_plan' => $this->getCustomPlan(),
403 'belongs_to' => $this->getBelongsTo(),
404 'assign_date' => $this->getAssignmentDate(),
405 'assigned_by' => $this->getAssignmentBy(),
406 'deadline' => $this->getDeadline(),
407 'expiry_date' => $this->getExpiryDate(),
408 'validity' => $this->getValidity(),
409 'cert_relevance' => $this->getCertificateRelevance(),
410 ];
411
412 foreach ($this->user_information->getAvailableUserFields() as $user_field) {
413 if (! array_key_exists($user_field, $ret)) {
414 $ret[$user_field] = $this->getUserData($user_field);
415 }
416 }
417
418 return $ret;
419 }
420}
Additional information about a user, used in context of assignments.
ilStudyProgrammeUserTable provides a flattened list of progresses at a programme-node.
__construct(protected int $ass_id, protected int $usr_id, protected int $node_obj_id, protected bool $is_root_progress, protected ilPRGUserInformation $user_information)
withPointsReachable(string $points_reachable)