ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStudyProgrammeUserAssignmentDB Class Reference
+ Collaboration diagram for ilStudyProgrammeUserAssignmentDB:

Public Member Functions

 __construct (ilStudyProgrammeUserProgressDB $sp_user_progress_db, ilStudyProgrammeAssignmentRepository $assignment_repository, ilTree $tree, ilStudyProgrammeEvents $sp_events)
 
 getInstanceById (int $id)
 
 getInstanceByModel (\ilStudyProgrammeAssignment $assignment)
 
 getInstancesOfUser (int $user_id)
 
 getInstancesForProgram (int $program_id)
 
 getDueToRestartInstances ()
 
 getDueToRestartAndMail ()
 
 reminderSendFor (int $assignment_id)
 
 getDashboardInstancesforUser (int $usr_id)
 

Protected Attributes

 $sp_user_progress_db
 
 $assignment_repository
 
 $tree
 
 $sp_events
 

Detailed Description

Definition at line 5 of file class.ilStudyProgrammeUserAssignmentDB.php.

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeUserAssignmentDB::__construct ( ilStudyProgrammeUserProgressDB  $sp_user_progress_db,
ilStudyProgrammeAssignmentRepository  $assignment_repository,
ilTree  $tree,
ilStudyProgrammeEvents  $sp_events 
)

Member Function Documentation

◆ getDashboardInstancesforUser()

ilStudyProgrammeUserAssignmentDB::getDashboardInstancesforUser ( int  $usr_id)

Definition at line 141 of file class.ilStudyProgrammeUserAssignmentDB.php.

References $ret.

141  : array
142  {
143  $ret = [];
144  $assigments_by_prg = $this->assignment_repository->getDashboardInstancesforUser($usr_id);
145  foreach ($assigments_by_prg as $prg => $assignments) {
146  $ret[$prg] = [];
147  foreach ($assignments as $id => $assignment) {
148  $ret[$prg][$id] = new ilStudyProgrammeUserAssignment(
149  $assignment,
150  $this->sp_user_progress_db,
151  $this->assignment_repository,
152  $this->sp_events
153  );
154  }
155  }
156  return $ret;
157  }
$ret
Definition: parser.php:6
Represents one assignment of a user to a study programme.

◆ getDueToRestartAndMail()

ilStudyProgrammeUserAssignmentDB::getDueToRestartAndMail ( )
Returns
ilStudyProgrammeUserAssignment[]

Definition at line 121 of file class.ilStudyProgrammeUserAssignmentDB.php.

121  : array
122  {
123  return array_map(
124  function ($ass) {
126  $ass,
127  $this->sp_user_progress_db,
128  $this->assignment_repository,
129  $this->sp_events
130  );
131  },
132  $this->assignment_repository->readDueToRestartAndMail()
133  );
134  }
Represents one assignment of a user to a study programme.

◆ getDueToRestartInstances()

ilStudyProgrammeUserAssignmentDB::getDueToRestartInstances ( )
Returns
ilStudyProgrammeUserAssignment[]

Definition at line 103 of file class.ilStudyProgrammeUserAssignmentDB.php.

103  : array
104  {
105  return array_map(
106  function ($ass) {
108  $ass,
109  $this->sp_user_progress_db,
110  $this->assignment_repository,
111  $this->sp_events
112  );
113  },
114  $this->assignment_repository->readDueToRestart()
115  );
116  }
Represents one assignment of a user to a study programme.

◆ getInstanceById()

ilStudyProgrammeUserAssignmentDB::getInstanceById ( int  $id)

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

40  {
41  $assignment = $this->assignment_repository->read($id);
42  if ($assignment === null) {
43  throw new ilException("ilStudyProgrammeUserAssignment::__construct: "
44  . "Unknown assignmemt id '$id'.");
45  }
47  $assignment,
48  $this->sp_user_progress_db,
49  $this->assignment_repository,
50  $this->sp_events
51  );
52  }
Represents one assignment of a user to a study programme.

◆ getInstanceByModel()

ilStudyProgrammeUserAssignmentDB::getInstanceByModel ( \ilStudyProgrammeAssignment  $assignment)

Definition at line 54 of file class.ilStudyProgrammeUserAssignmentDB.php.

55  {
57  $assignment,
58  $this->sp_user_progress_db,
59  $this->assignment_repository,
60  $this->sp_events
61  );
62  }
Represents one assignment of a user to a study programme.

◆ getInstancesForProgram()

ilStudyProgrammeUserAssignmentDB::getInstancesForProgram ( int  $program_id)

Definition at line 87 of file class.ilStudyProgrammeUserAssignmentDB.php.

88  {
89  $assignments = $this->assignment_repository->readByPrgId($program_id);
90  return array_map(function ($ass) {
92  $ass,
93  $this->sp_user_progress_db,
94  $this->assignment_repository,
95  $this->sp_events
96  );
97  }, array_values($assignments)); // use array values since we want keys 0...
98  }
Represents one assignment of a user to a study programme.

◆ getInstancesOfUser()

ilStudyProgrammeUserAssignmentDB::getInstancesOfUser ( int  $user_id)

Definition at line 64 of file class.ilStudyProgrammeUserAssignmentDB.php.

References $ret, and ilObject\_getAllReferences().

65  {
66  $assignments = $this->assignment_repository->readByUsrId($user_id);
67 
68  //if parent object is deleted or in trash
69  //the assignment for the user should not be returned
70  $ret = [];
71  foreach ($assignments as $ass) {
72  foreach (ilObject::_getAllReferences($ass->getRootId()) as $value) {
73  if ($this->tree->isInTree($value)) {
75  $ass,
76  $this->sp_user_progress_db,
77  $this->assignment_repository,
78  $this->sp_events
79  );
80  continue 2;
81  }
82  }
83  }
84  return $ret;
85  }
static _getAllReferences($a_id)
get all reference ids of object
$ret
Definition: parser.php:6
Represents one assignment of a user to a study programme.
+ Here is the call graph for this function:

◆ reminderSendFor()

ilStudyProgrammeUserAssignmentDB::reminderSendFor ( int  $assignment_id)

Definition at line 136 of file class.ilStudyProgrammeUserAssignmentDB.php.

136  : void
137  {
138  $this->assignment_repository->reminderSendFor($assignment_id);
139  }

Field Documentation

◆ $assignment_repository

ilStudyProgrammeUserAssignmentDB::$assignment_repository
protected

Definition at line 15 of file class.ilStudyProgrammeUserAssignmentDB.php.

Referenced by __construct().

◆ $sp_events

ilStudyProgrammeUserAssignmentDB::$sp_events
protected

Definition at line 25 of file class.ilStudyProgrammeUserAssignmentDB.php.

Referenced by __construct().

◆ $sp_user_progress_db

ilStudyProgrammeUserAssignmentDB::$sp_user_progress_db
protected

Definition at line 10 of file class.ilStudyProgrammeUserAssignmentDB.php.

Referenced by __construct().

◆ $tree

ilStudyProgrammeUserAssignmentDB::$tree
protected

Definition at line 20 of file class.ilStudyProgrammeUserAssignmentDB.php.

Referenced by __construct().


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