ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilStudyProgrammeProgressDBRepository Class Reference
+ Inheritance diagram for ilStudyProgrammeProgressDBRepository:
+ Collaboration diagram for ilStudyProgrammeProgressDBRepository:

Public Member Functions

 __construct (ilDBInterface $db)
 
 createFor (ilStudyProgrammeSettings $prg, ilStudyProgrammeAssignment $ass)
 Create a record corresponding to a progress and return corresponding object.Will throw if a record allready exists. More...
 
 read (int $id)
 Load progress belonging to a id.Will throw if the record does not exist yet. More...
 
 readByIds (int $prg_id, int $assignment_id, int $usr_id)
 Load progress belonging to a prg id and assignment.Will throw if the record does not exist yet. More...
 
 readByPrgIdAndAssignmentId (int $prg_id, int $assignment_id)
 Load progress belonging to a prg id and assignment.Will throw if the record does not exist yet. More...
 
 readByPrgIdAndUserId (int $prg_id, int $usr_id)
 Load progress objects belonging to a prg id and a user id. More...
 
 readByPrgId (int $prg_id)
 Load progress objects belonging to a prg id. More...
 
 readFirstByPrgId (int $prg_id)
 
 readByAssignmentId (int $assignment_id)
 Load progress objects belonging to an assignment id.Will throw if the record does not exist yet. More...
 
 readExpiredSuccessfull ()
 Load all progress objects which are successfull and whose validity is expired. More...
 
 readPassedDeadline ()
 @inheritDoc More...
 
 readRiskyToFailInstances ()
 
 update (ilStudyProgrammeProgress $progress)
 Update record corresponding to progress.Will throw if the record does not exist yet. More...
 
 delete (ilStudyProgrammeProgress $progress)
 Delete record corresponding to progress.Will throw if the record does not exist yet. More...
 
 deleteDB (int $id)
 
 reminderSendFor (int $progress_id)
 
 createFor (ilStudyProgrammeSettings $prg, ilStudyProgrammeAssignment $ass)
 Create a record corresponding to a progress and return corresponding object. More...
 
 read (int $id)
 Load progress belonging to a id. More...
 
 readByIds (int $prg_id, int $assignment_id, int $usr_id)
 Load progress belonging to a prg id and assignment. More...
 
 readByPrgIdAndAssignmentId (int $prg_id, int $assignment_id)
 Load progress belonging to a prg id and assignment. More...
 
 readByPrgIdAndUserId (int $prg_id, int $usr_id)
 Load progress objects belonging to a prg id and a user id. More...
 
 readByPrgId (int $prg_id)
 Load progress objects belonging to a prg id. More...
 
 readFirstByPrgId (int $prg_id)
 Load the first progress objects belonging to a prg id. More...
 
 readByAssignmentId (int $assignment_id)
 Load progress objects belonging to an assignment id. More...
 
 readExpiredSuccessfull ()
 Load all progress objects which are successfull and whose validity is expired. More...
 
 readRiskyToFailInstances ()
 
 readPassedDeadline ()
 
 update (ilStudyProgrammeProgress $progress)
 Update record corresponding to progress. More...
 
 delete (ilStudyProgrammeProgress $progress)
 Delete record corresponding to progress. More...
 

Data Fields

const TABLE = 'prg_usr_progress'
 
const FIELD_ID = 'id'
 
const FIELD_ASSIGNMENT_ID = 'assignment_id'
 
const FIELD_PRG_ID = 'prg_id'
 
const FIELD_USR_ID = 'usr_id'
 
const FIELD_POINTS = 'points'
 
const FIELD_POINTS_CUR = 'points_cur'
 
const FIELD_STATUS = 'status'
 
const FIELD_COMPLETION_BY = 'completion_by'
 
const FIELD_ASSIGNMENT_DATE = 'assignment_date'
 
const FIELD_LAST_CHANGE = 'last_change'
 
const FIELD_LAST_CHANGE_BY = 'last_change_by'
 
const FIELD_COMPLETION_DATE = 'completion_date'
 
const FIELD_DEADLINE = 'deadline'
 
const FIELD_VQ_DATE = 'vq_date'
 
const FIELD_INVALIDATED = 'invalidated'
 
const FIELD_MAIL_SEND = 'risky_to_fail_mail_send'
 

Protected Member Functions

 insertRowDB (array $row)
 
 updateRowDB (array $data)
 
 buildByRow (array $row)
 
 loadByFilter (array $filter)
 
 loadExpiredSuccessful ()
 
 loadPassedDeadline ()
 
 loadRiskyToFailInstance ()
 
 getSQLHeader ()
 
 nextId ()
 

Protected Attributes

 $db
 

Static Protected Attributes

static $cache = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeProgressDBRepository::__construct ( ilDBInterface  $db)

Member Function Documentation

◆ buildByRow()

ilStudyProgrammeProgressDBRepository::buildByRow ( array  $row)
protected
Exceptions
ilException

Definition at line 368 of file class.ilStudyProgrammeProgressDBRepository.php.

369 {
370 $prgrs = (new ilStudyProgrammeProgress((int) $row[self::FIELD_ID]))
371 ->setAssignmentId((int) $row[self::FIELD_ASSIGNMENT_ID])
372 ->setNodeId((int) $row[self::FIELD_PRG_ID])
373 ->setUserId((int) $row[self::FIELD_USR_ID])
374 ->setStatus((int) $row[self::FIELD_STATUS])
375 ->setAmountOfPoints((int) $row[self::FIELD_POINTS])
376 ->setCurrentAmountOfPoints((int) $row[self::FIELD_POINTS_CUR])
377 ->setCompletionBy((int) $row[self::FIELD_COMPLETION_BY])
378 ->setDeadline(
379 $row[self::FIELD_DEADLINE] ?
380 DateTime::createFromFormat(ilStudyProgrammeProgress::DATE_FORMAT, $row[self::FIELD_DEADLINE]) :
381 null
382 )
383 ->setAssignmentDate(
384 DateTime::createFromFormat(ilStudyProgrammeProgress::DATE_TIME_FORMAT, $row[self::FIELD_ASSIGNMENT_DATE])
385 )
386 ->setCompletionDate(
387 $row[self::FIELD_COMPLETION_DATE] ?
388 DateTime::createFromFormat(ilStudyProgrammeProgress::DATE_TIME_FORMAT, $row[self::FIELD_COMPLETION_DATE]) :
389 null
390 )
391 ->setLastChange(
392 $row[self::FIELD_LAST_CHANGE] ?
393 DateTime::createFromFormat(ilStudyProgrammeProgress::DATE_TIME_FORMAT, $row[self::FIELD_LAST_CHANGE]) :
394 null
395 )
396 ->setValidityOfQualification(
397 $row[self::FIELD_VQ_DATE] ?
398 DateTime::createFromFormat(ilStudyProgrammeProgress::DATE_TIME_FORMAT, $row[self::FIELD_VQ_DATE]) :
399 null
400 );
401 if ((int) $row[self::FIELD_INVALIDATED] === 1) {
402 $prgrs = $prgrs->invalidate();
403 }
404
405 if (!is_null($row[self::FIELD_LAST_CHANGE_BY])) {
406 $prgrs = $prgrs->setLastChangeBy((int) $row[self::FIELD_LAST_CHANGE_BY]);
407 }
408
409 return $prgrs;
410 }
Class ilStudyProgrammeProgress.

References ilStudyProgrammeProgress\DATE_FORMAT, ilStudyProgrammeProgress\DATE_TIME_FORMAT, and ilStudyProgrammeProgress\invalidate().

+ Here is the call graph for this function:

◆ createFor()

ilStudyProgrammeProgressDBRepository::createFor ( ilStudyProgrammeSettings  $prg,
ilStudyProgrammeAssignment  $ass 
)

Create a record corresponding to a progress and return corresponding object.Will throw if a record allready exists.

Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 39 of file class.ilStudyProgrammeProgressDBRepository.php.

43 $id = $this->nextId();
44 $row = [
45 self::FIELD_ID => $id,
46 self::FIELD_ASSIGNMENT_ID => $ass->getId(),
47 self::FIELD_PRG_ID => $prg->getObjId(),
48 self::FIELD_USR_ID => $ass->getUserId(),
49 self::FIELD_POINTS => $prg->getAssessmentSettings()->getPoints(),
50 self::FIELD_POINTS_CUR => 0,
52 self::FIELD_COMPLETION_BY => null,
53 self::FIELD_LAST_CHANGE => ilUtil::now(),
54 self::FIELD_ASSIGNMENT_DATE => ilUtil::now(),
55 self::FIELD_LAST_CHANGE_BY => null,
56 self::FIELD_COMPLETION_DATE => null,
57 self::FIELD_DEADLINE => null,
58 self::FIELD_VQ_DATE => null,
59 self::FIELD_INVALIDATED => 0
60 ];
61 $this->insertRowDB($row);
62 return $this->buildByRow($row);
63 }
getUserId()
Get the id of the user who is assigned.
getId()
Get the id of the assignment.
getObjId()
Get the id of the study program.
static now()
Return current timestamp in Y-m-d H:i:s format.

◆ delete()

ilStudyProgrammeProgressDBRepository::delete ( ilStudyProgrammeProgress  $progress)

Delete record corresponding to progress.Will throw if the record does not exist yet.

Implements ilStudyProgrammeProgressRepository.

Definition at line 239 of file class.ilStudyProgrammeProgressDBRepository.php.

240 {
241 $this->deleteDB($progress->getId());
242 }
getId()
Get the id of the progress.

◆ deleteDB()

ilStudyProgrammeProgressDBRepository::deleteDB ( int  $id)

Definition at line 268 of file class.ilStudyProgrammeProgressDBRepository.php.

269 {
270 $this->db->manipulate(
271 'DELETE FROM ' . self::TABLE . ' WHERE ' . self::FIELD_ID . ' = ' . $this->db->quote($id, 'integer')
272 );
273 }

◆ getSQLHeader()

ilStudyProgrammeProgressDBRepository::getSQLHeader ( )
protected

Definition at line 502 of file class.ilStudyProgrammeProgressDBRepository.php.

502 : string
503 {
504 return 'SELECT ' . self::FIELD_ID
505 . ', ' . self::FIELD_ASSIGNMENT_ID
506 . ', ' . self::FIELD_PRG_ID
507 . ', ' . self::FIELD_USR_ID
508 . ', ' . self::FIELD_STATUS
509 . ', ' . self::FIELD_POINTS
510 . ', ' . self::FIELD_POINTS_CUR
511 . ', ' . self::FIELD_COMPLETION_BY
512 . ', ' . self::FIELD_LAST_CHANGE
513 . ', ' . self::FIELD_LAST_CHANGE_BY
514 . ', ' . self::FIELD_ASSIGNMENT_DATE
515 . ', ' . self::FIELD_COMPLETION_DATE
516 . ', ' . self::FIELD_DEADLINE
517 . ', ' . self::FIELD_VQ_DATE
518 . ', ' . self::FIELD_INVALIDATED
519 . ' FROM ' . self::TABLE;
520 }

◆ insertRowDB()

ilStudyProgrammeProgressDBRepository::insertRowDB ( array  $row)
protected

Definition at line 244 of file class.ilStudyProgrammeProgressDBRepository.php.

245 {
246 $this->db->insert(
247 self::TABLE,
248 [
249 self::FIELD_ID => ['integer', $row[self::FIELD_ID]]
250 , self::FIELD_ASSIGNMENT_ID => ['integer', $row[self::FIELD_ASSIGNMENT_ID]]
251 , self::FIELD_PRG_ID => ['integer', $row[self::FIELD_PRG_ID]]
252 , self::FIELD_USR_ID => ['integer', $row[self::FIELD_USR_ID]]
253 , self::FIELD_STATUS => ['integer', $row[self::FIELD_STATUS]]
254 , self::FIELD_POINTS => ['integer', $row[self::FIELD_POINTS]]
255 , self::FIELD_POINTS_CUR => ['integer', $row[self::FIELD_POINTS_CUR]]
256 , self::FIELD_COMPLETION_BY => ['integer', $row[self::FIELD_COMPLETION_BY]]
257 , self::FIELD_LAST_CHANGE_BY => ['integer', $row[self::FIELD_LAST_CHANGE_BY]]
258 , self::FIELD_LAST_CHANGE => ['text', $row[self::FIELD_LAST_CHANGE]]
259 , self::FIELD_ASSIGNMENT_DATE => ['timestamp', $row[self::FIELD_ASSIGNMENT_DATE]]
260 , self::FIELD_COMPLETION_DATE => ['timestamp', $row[self::FIELD_COMPLETION_DATE]]
261 , self::FIELD_DEADLINE => ['text', $row[self::FIELD_DEADLINE]]
262 , self::FIELD_VQ_DATE => ['timestamp', $row[self::FIELD_VQ_DATE]]
263 , self::FIELD_INVALIDATED => ['timestamp', $row[self::FIELD_INVALIDATED]]
264 ]
265 );
266 }

◆ loadByFilter()

ilStudyProgrammeProgressDBRepository::loadByFilter ( array  $filter)
protected

Definition at line 412 of file class.ilStudyProgrammeProgressDBRepository.php.

413 {
414 $q = $this->getSQLHeader()
415 . ' WHERE TRUE';
416 foreach ($filter as $field => $value) {
417 $q .= ' AND ' . $field . ' = ' . $this->db->quote($value, 'text');
418 }
419 $res = $this->db->query($q);
420 while ($rec = $this->db->fetchAssoc($res)) {
421 yield $rec;
422 }
423 }
foreach($_POST as $key=> $value) $res

References $res.

◆ loadExpiredSuccessful()

ilStudyProgrammeProgressDBRepository::loadExpiredSuccessful ( )
protected

Definition at line 425 of file class.ilStudyProgrammeProgressDBRepository.php.

426 {
427 $q = $this->getSQLHeader()
428 . ' WHERE ' . $this->db->in(
429 self::FIELD_STATUS,
430 [
433 ],
434 false,
435 'integer'
436 )
437 . ' AND ' . self::FIELD_VQ_DATE . ' IS NOT NULL'
438 . ' AND DATE(' . self::FIELD_VQ_DATE . ') < '
439 . $this->db->quote(
440 (new DateTime())->format(ilStudyProgrammeProgress::DATE_FORMAT),
441 'text'
442 )
443 . ' AND ' . self::FIELD_INVALIDATED . ' != 1 OR ' . self::FIELD_INVALIDATED . ' IS NULL';
444
445 $res = $this->db->query($q);
446 while ($rec = $this->db->fetchAssoc($res)) {
447 yield $rec;
448 }
449 }

References $res, ilStudyProgrammeProgress\DATE_FORMAT, ilStudyProgrammeProgress\STATUS_ACCREDITED, and ilStudyProgrammeProgress\STATUS_COMPLETED.

◆ loadPassedDeadline()

ilStudyProgrammeProgressDBRepository::loadPassedDeadline ( )
protected

Definition at line 451 of file class.ilStudyProgrammeProgressDBRepository.php.

452 {
453 $q =
454 $this->getSQLHeader() . PHP_EOL
455 . 'WHERE ' . $this->db->in(
456 self::FIELD_STATUS,
457 [
460 ],
461 false,
462 'integer'
463 ) . PHP_EOL
464 . 'AND ' . self::FIELD_DEADLINE . ' IS NOT NULL' . PHP_EOL
465 . 'AND DATE(' . self::FIELD_DEADLINE . ') < ' . $this->db->quote(
466 (new DateTime())->format(ilStudyProgrammeProgress::DATE_FORMAT),
467 'text'
468 ) . PHP_EOL
469 ;
470 $res = $this->db->query($q);
471 while ($rec = $this->db->fetchAssoc($res)) {
472 yield $rec;
473 }
474 }

References $res, ilStudyProgrammeProgress\DATE_FORMAT, ilStudyProgrammeProgress\STATUS_ACCREDITED, and ilStudyProgrammeProgress\STATUS_IN_PROGRESS.

◆ loadRiskyToFailInstance()

ilStudyProgrammeProgressDBRepository::loadRiskyToFailInstance ( )
protected

Definition at line 476 of file class.ilStudyProgrammeProgressDBRepository.php.

477 {
478 $q = $this->getSQLHeader()
479 . ' WHERE ' . $this->db->in(
480 self::FIELD_STATUS,
481 [
484 ],
485 true,
486 'integer'
487 )
488 . ' AND ' . self::FIELD_DEADLINE . ' IS NOT NULL'
489 . ' AND DATE(' . self::FIELD_DEADLINE . ') < '
490 . $this->db->quote(
491 (new DateTime())->format(ilStudyProgrammeProgress::DATE_FORMAT),
492 'text'
493 )
494 . ' AND ' . self::FIELD_MAIL_SEND . ' IS NULL'
495 ;
496 $res = $this->db->query($q);
497 while ($rec = $this->db->fetchAssoc($res)) {
498 yield $rec;
499 }
500 }

References $res, ilStudyProgrammeProgress\DATE_FORMAT, ilStudyProgrammeProgress\STATUS_ACCREDITED, and ilStudyProgrammeProgress\STATUS_COMPLETED.

◆ nextId()

ilStudyProgrammeProgressDBRepository::nextId ( )
protected

Definition at line 522 of file class.ilStudyProgrammeProgressDBRepository.php.

522 : int
523 {
524 return (int) $this->db->nextId(self::TABLE);
525 }

◆ read()

ilStudyProgrammeProgressDBRepository::read ( int  $id)

Load progress belonging to a id.Will throw if the record does not exist yet.

Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 70 of file class.ilStudyProgrammeProgressDBRepository.php.

71 {
72 foreach ($this->loadByFilter([self::FIELD_ID => $id]) as $row) {
73 return $this->buildByRow($row);
74 }
75 throw new ilException('invalid id ' . $id);
76 }
Base class for ILIAS Exception handling.

◆ readByAssignmentId()

ilStudyProgrammeProgressDBRepository::readByAssignmentId ( int  $assignment_id)

Load progress objects belonging to an assignment id.Will throw if the record does not exist yet.

Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 157 of file class.ilStudyProgrammeProgressDBRepository.php.

157 : array
158 {
159 $return = [];
160 foreach ($this->loadByFilter([self::FIELD_ASSIGNMENT_ID => $assignment_id]) as $row) {
161 $return[] = $this->buildByRow($row);
162 }
163 return $return;
164 }

◆ readByIds()

ilStudyProgrammeProgressDBRepository::readByIds ( int  $prg_id,
int  $assignment_id,
int  $usr_id 
)

Load progress belonging to a prg id and assignment.Will throw if the record does not exist yet.

Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 84 of file class.ilStudyProgrammeProgressDBRepository.php.

89 return $this->readByPrgIdAndAssignmentId($prg_id, $assignment_id);
90 }
readByPrgIdAndAssignmentId(int $prg_id, int $assignment_id)
Load progress belonging to a prg id and assignment.Will throw if the record does not exist yet.

◆ readByPrgId()

ilStudyProgrammeProgressDBRepository::readByPrgId ( int  $prg_id)

Load progress objects belonging to a prg id.

Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 132 of file class.ilStudyProgrammeProgressDBRepository.php.

132 : array
133 {
134 $return = [];
135 foreach ($this->loadByFilter([self::FIELD_PRG_ID => $prg_id]) as $row) {
136 $return[] = $this->buildByRow($row);
137 }
138 return $return;
139 }

◆ readByPrgIdAndAssignmentId()

ilStudyProgrammeProgressDBRepository::readByPrgIdAndAssignmentId ( int  $prg_id,
int  $assignment_id 
)

Load progress belonging to a prg id and assignment.Will throw if the record does not exist yet.

Exceptions
ilException
Returns
ilStudyProgrammeProgress | void

Implements ilStudyProgrammeProgressRepository.

Definition at line 99 of file class.ilStudyProgrammeProgressDBRepository.php.

100 {
101 $rows = $this->loadByFilter(
102 [
103 self::FIELD_PRG_ID => $prg_id,
104 self::FIELD_ASSIGNMENT_ID => $assignment_id
105 ]
106 );
107
108 foreach ($rows as $row) {
109 return $this->buildByRow($row);
110 }
111 }
$rows
Definition: xhr_table.php:10

References $rows.

◆ readByPrgIdAndUserId()

ilStudyProgrammeProgressDBRepository::readByPrgIdAndUserId ( int  $prg_id,
int  $usr_id 
)

Load progress objects belonging to a prg id and a user id.

Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 118 of file class.ilStudyProgrammeProgressDBRepository.php.

118 : array
119 {
120 $return = [];
121 foreach ($this->loadByFilter([self::FIELD_PRG_ID => $prg_id, self::FIELD_USR_ID => $usr_id]) as $row) {
122 $return[] = $this->buildByRow($row);
123 }
124 return $return;
125 }

◆ readExpiredSuccessfull()

ilStudyProgrammeProgressDBRepository::readExpiredSuccessfull ( )

Load all progress objects which are successfull and whose validity is expired.

Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 171 of file class.ilStudyProgrammeProgressDBRepository.php.

171 : array
172 {
173 $return = [];
174 foreach ($this->loadExpiredSuccessful() as $row) {
175 $return[] = $this->buildByRow($row);
176 }
177 return $return;
178 }

◆ readFirstByPrgId()

ilStudyProgrammeProgressDBRepository::readFirstByPrgId ( int  $prg_id)
Returns
ilStudyProgrammeProgress | void
Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 145 of file class.ilStudyProgrammeProgressDBRepository.php.

146 {
147 foreach ($this->loadByFilter([self::FIELD_PRG_ID => $prg_id]) as $row) {
148 return $this->buildByRow($row);
149 }
150 }

◆ readPassedDeadline()

ilStudyProgrammeProgressDBRepository::readPassedDeadline ( )

@inheritDoc

Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 185 of file class.ilStudyProgrammeProgressDBRepository.php.

185 : array
186 {
187 $return = [];
188 foreach ($this->loadPassedDeadline() as $row) {
189 $return[] = $this->buildByRow($row);
190 }
191 return $return;
192 }

◆ readRiskyToFailInstances()

ilStudyProgrammeProgressDBRepository::readRiskyToFailInstances ( )

Exceptions
ilException

Implements ilStudyProgrammeProgressRepository.

Definition at line 199 of file class.ilStudyProgrammeProgressDBRepository.php.

199 : array
200 {
201 $return = [];
202 foreach ($this->loadRiskyToFailInstance() as $row) {
203 $return[] = $this->buildByRow($row);
204 }
205 return $return;
206 }

◆ reminderSendFor()

ilStudyProgrammeProgressDBRepository::reminderSendFor ( int  $progress_id)

Definition at line 275 of file class.ilStudyProgrammeProgressDBRepository.php.

275 : void
276 {
277 $where = [
278 self::FIELD_ID => [
279 'integer',
280 $progress_id
281 ]
282 ];
283
284 $values = [
285 self::FIELD_MAIL_SEND => [
286 'timestamp',
287 date('Y-m-d H:i:s')
288 ]
289 ];
290
291 $this->db->update(self::TABLE, $values, $where);
292 }

◆ update()

ilStudyProgrammeProgressDBRepository::update ( ilStudyProgrammeProgress  $progress)

Update record corresponding to progress.Will throw if the record does not exist yet.

Implements ilStudyProgrammeProgressRepository.

Definition at line 211 of file class.ilStudyProgrammeProgressDBRepository.php.

212 {
213 $this->updateRowDB(
214 [
215 self::FIELD_ID => $progress->getId(),
216 self::FIELD_ASSIGNMENT_ID => $progress->getAssignmentId(),
217 self::FIELD_PRG_ID => $progress->getNodeId(),
218 self::FIELD_USR_ID => $progress->getUserId(),
219 self::FIELD_STATUS => $progress->getStatus(),
220 self::FIELD_POINTS => $progress->getAmountOfPoints(),
221 self::FIELD_POINTS_CUR => $progress->getCurrentAmountOfPoints(),
222 self::FIELD_COMPLETION_BY => $progress->getCompletionBy(),
223 self::FIELD_LAST_CHANGE_BY => $progress->getLastChangeBy(),
224 self::FIELD_LAST_CHANGE => $progress->getLastChange()->format(ilStudyProgrammeProgress::DATE_TIME_FORMAT),
225 self::FIELD_ASSIGNMENT_DATE => $progress->getAssignmentDate()->format(ilStudyProgrammeProgress::DATE_TIME_FORMAT),
226 self::FIELD_COMPLETION_DATE =>
227 $progress->getCompletionDate() ?
229 self::FIELD_DEADLINE => $progress->getDeadline() ? $progress->getDeadline()->format(ilStudyProgrammeProgress::DATE_FORMAT) : null,
230 self::FIELD_VQ_DATE => $progress->getValidityOfQualification() ? $progress->getValidityOfQualification()->format(ilStudyProgrammeProgress::DATE_TIME_FORMAT) : null,
231 self::FIELD_INVALIDATED => $progress->isInvalidated() ? 1 : 0
232 ]
233 );
234 }
getAssignmentDate()
Get the date of assignment.
getAssignmentId()
Get the assignment, this progress belongs to.
getAmountOfPoints()
Get the amount of points the user needs to achieve on the subnodes of this node.
getStatus()
Get the status the user has on this node.
getUserId()
Get the id of the user this progress is for.
getValidityOfQualification()
Get the limited validity of qualification date.
getLastChange()
Get the timestamp of the last change on this progress.
getCompletionBy()
Get the id of object or user that lead to the successful completion of this node.
getLastChangeBy()
Get the id of the user who did the last change on this assignment.
getCurrentAmountOfPoints()
Get the amount of points the user currently has achieved on the node.
getCompletionDate()
Get the timestamp of the complition of this progress.
getNodeId()
Get the id of the program node this progress belongs to.
getDeadline()
Get the deadline of this progress.

References ilStudyProgrammeProgress\DATE_FORMAT, ilStudyProgrammeProgress\DATE_TIME_FORMAT, ilStudyProgrammeProgress\getAmountOfPoints(), ilStudyProgrammeProgress\getAssignmentDate(), ilStudyProgrammeProgress\getAssignmentId(), ilStudyProgrammeProgress\getCompletionBy(), ilStudyProgrammeProgress\getCompletionDate(), ilStudyProgrammeProgress\getCurrentAmountOfPoints(), ilStudyProgrammeProgress\getDeadline(), ilStudyProgrammeProgress\getId(), ilStudyProgrammeProgress\getLastChange(), ilStudyProgrammeProgress\getLastChangeBy(), ilStudyProgrammeProgress\getNodeId(), ilStudyProgrammeProgress\getStatus(), ilStudyProgrammeProgress\getUserId(), ilStudyProgrammeProgress\getValidityOfQualification(), and ilStudyProgrammeProgress\isInvalidated().

+ Here is the call graph for this function:

◆ updateRowDB()

ilStudyProgrammeProgressDBRepository::updateRowDB ( array  $data)
protected

Definition at line 294 of file class.ilStudyProgrammeProgressDBRepository.php.

295 {
296 $where = [
297 self::FIELD_ID => [
298 'integer',
300 ]
301 ];
302
303 $values = [
304 self::FIELD_ASSIGNMENT_ID => [
305 'integer',
307 ],
308 self::FIELD_PRG_ID => [
309 'integer',
311 ],
312 self::FIELD_USR_ID => [
313 'integer',
315 ],
316 self::FIELD_STATUS => [
317 'integer',
319 ],
320 self::FIELD_POINTS => [
321 'integer',
323 ],
324 self::FIELD_POINTS_CUR => [
325 'integer',
327 ],
328 self::FIELD_COMPLETION_BY => [
329 'integer',
331 ],
332 self::FIELD_LAST_CHANGE_BY => [
333 'integer',
335 ],
336 self::FIELD_LAST_CHANGE => [
337 'text',
339 ],
340 self::FIELD_ASSIGNMENT_DATE => [
341 'timestamp',
343 ],
344 self::FIELD_COMPLETION_DATE => [
345 'timestamp',
347 ],
348 self::FIELD_DEADLINE => [
349 'text',
351 ],
352 self::FIELD_VQ_DATE => [
353 'timestamp',
355 ],
356 self::FIELD_INVALIDATED => [
357 'integer',
359 ],
360 ];
361
362 $this->db->update(self::TABLE, $values, $where);
363 }
$data
Definition: storeScorm.php:23

References $data.

Field Documentation

◆ $cache

ilStudyProgrammeProgressDBRepository::$cache = []
staticprotected

◆ $db

ilStudyProgrammeProgressDBRepository::$db
protected

Definition at line 8 of file class.ilStudyProgrammeProgressDBRepository.php.

Referenced by __construct().

◆ FIELD_ASSIGNMENT_DATE

const ilStudyProgrammeProgressDBRepository::FIELD_ASSIGNMENT_DATE = 'assignment_date'

◆ FIELD_ASSIGNMENT_ID

const ilStudyProgrammeProgressDBRepository::FIELD_ASSIGNMENT_ID = 'assignment_id'

◆ FIELD_COMPLETION_BY

const ilStudyProgrammeProgressDBRepository::FIELD_COMPLETION_BY = 'completion_by'

◆ FIELD_COMPLETION_DATE

const ilStudyProgrammeProgressDBRepository::FIELD_COMPLETION_DATE = 'completion_date'

◆ FIELD_DEADLINE

const ilStudyProgrammeProgressDBRepository::FIELD_DEADLINE = 'deadline'

◆ FIELD_ID

const ilStudyProgrammeProgressDBRepository::FIELD_ID = 'id'

◆ FIELD_INVALIDATED

const ilStudyProgrammeProgressDBRepository::FIELD_INVALIDATED = 'invalidated'

◆ FIELD_LAST_CHANGE

const ilStudyProgrammeProgressDBRepository::FIELD_LAST_CHANGE = 'last_change'

◆ FIELD_LAST_CHANGE_BY

const ilStudyProgrammeProgressDBRepository::FIELD_LAST_CHANGE_BY = 'last_change_by'

◆ FIELD_MAIL_SEND

const ilStudyProgrammeProgressDBRepository::FIELD_MAIL_SEND = 'risky_to_fail_mail_send'

◆ FIELD_POINTS

const ilStudyProgrammeProgressDBRepository::FIELD_POINTS = 'points'

◆ FIELD_POINTS_CUR

const ilStudyProgrammeProgressDBRepository::FIELD_POINTS_CUR = 'points_cur'

◆ FIELD_PRG_ID

const ilStudyProgrammeProgressDBRepository::FIELD_PRG_ID = 'prg_id'

◆ FIELD_STATUS

const ilStudyProgrammeProgressDBRepository::FIELD_STATUS = 'status'

◆ FIELD_USR_ID

const ilStudyProgrammeProgressDBRepository::FIELD_USR_ID = 'usr_id'

◆ FIELD_VQ_DATE

const ilStudyProgrammeProgressDBRepository::FIELD_VQ_DATE = 'vq_date'

◆ TABLE

const ilStudyProgrammeProgressDBRepository::TABLE = 'prg_usr_progress'

The documentation for this class was generated from the following file: