1 <?php declare(strict_types=1);
4 trait ProgressRepoMockNIFT
12 throw new Exception(
"Not implemented for testing", 1);
18 public function getByPrgIdAndUserId(
int $prg_id,
int $usr_id) : array
20 throw new Exception(
"Not implemented for testing", 1);
22 public function getByPrgId(
int $prg_id) : array
24 throw new Exception(
"Not implemented for testing", 1);
26 public function getFirstByPrgId(
int $prg_id)
28 throw new Exception(
"Not implemented for testing", 1);
30 public function getExpiredSuccessfull() : array
32 throw new Exception(
"Not implemented for testing", 1);
34 public function getRiskyToFailInstances() : array
36 throw new Exception(
"Not implemented for testing", 1);
38 public function getPassedDeadline() : array
40 throw new Exception(
"Not implemented for testing", 1);
44 throw new Exception(
"Not implemented for testing", 1);
46 public function createFor(
50 throw new Exception(
"Not implemented for testing", 1);
54 trait AssignmentRepoMockNIFT
62 throw new Exception(
"Not implemented for testing", 1);
64 public function getByUsrId(
int $usr_id) : array
66 throw new Exception(
"Not implemented for testing", 1);
68 public function getByPrgId(
int $prg_id) : array
70 throw new Exception(
"Not implemented for testing", 1);
72 public function getDueToRestart() : array
74 throw new Exception(
"Not implemented for testing", 1);
76 public function getDueToManuelRestart(
int $days_before_end) : array
78 throw new Exception(
"Not implemented for testing", 1);
82 throw new Exception(
"Not implemented for testing", 1);
86 trait SettingsRepoMockNIFT
94 throw new Exception(
"Not implemented for testing", 1);
98 throw new Exception(
"Not implemented for testing", 1);
100 public function loadByType(
int $type_id) : array
102 throw new Exception(
"Not implemented for testing", 1);
104 public function loadIdsByType(
int $type_id) : array
106 throw new Exception(
"Not implemented for testing", 1);
113 public $progresses = [];
115 use ProgressRepoMockNIFT;
119 return $this->progresses[$id];
124 $this->progresses[$progress->
getNodeId()] = $progress;
129 return $this->progresses[$prg_id];
135 foreach ($this->progresses as $progress_id => $progress) {
146 public $assignments = [];
148 use AssignmentRepoMockNIFT;
150 public function get(
int $id)
152 return $this->assignments[$id];
156 $this->assignments[$assignment->
getId()] = $assignment;
162 public $settings = [];
164 use SettingsRepoMockNIFT;
193 $this->events =
new class() {
200 public function throwIfNotInTree() : void
204 public function update() : void
206 $this->updateSettings();
208 protected function getLoggedInUserId() : int
215 return (
string) $progress->
getId();
220 return $this->env->progress_repo;
224 return $this->env->assignment_repo;
228 return $this->env->settings_repo;
231 protected function refreshLPStatus(
int $usr_id) : void
237 $parent_id = $this->env->mock_tree[$progress->
getNodeId()][
'parent'];
238 if (is_null($parent_id)) {
241 return $this->getProgressRepository()->get($parent_id);
244 public function getChildrenProgress($progress) : array
247 foreach ($this->env->mock_tree[$progress->
getNodeId()][
'children'] as $child_id) {
248 $progresses[] = $this->getProgressRepository()->get($child_id);
255 return $this->updateParentProgress($progress);
260 return $this->applyProgressDeadline($progress);
265 return $this->tree[$obj_id][
'prg'];
268 public function hasChildren(
bool $include_references =
false) : bool
270 if ($this->
id < 12) {
286 public function raise($event, $parameter) :
void 288 $this->raised[] = [$event, $parameter];
getAssignmentId()
Get the assignment this progress belongs to.
update(ilStudyProgrammeProgress $progress)
Update record corresponding to progress.
getByAssignmentId(int $assignment_id)
Load progress objects belonging to an assignment id.
getId()
Get the id of the progress.
Covers the persistence of settings belonging to a study programme (SP).
Represents one assignment of the user to a program tree.
Class ilStudyProgrammeProgress.
getObjId()
Get the id of the study program.
getByPrgIdAndAssignmentId(int $prg_id, int $assignment_id)
Load progress belonging to a prg id and assignment.
__construct(Container $dic, ilPlugin $plugin)
Covers the persistence of settings belonging to a study programme (SP).
getNodeId()
Get the obj_id of the program node this progress belongs to.