44 $query =
'SELECT id FROM ecs_course_assignments ' .
45 'WHERE usr_id = ' . $ilDB->quote($a_usr_id,
'text');
50 $assignments =
array();
52 $assignments[] =
new self(
$row->id);
64 $query =
'DELETE FROM ecs_course_assignments ' .
65 'WHERE obj_id = ' . $ilDB->quote($a_obj_id,
'integer');
80 $query =
'DELETE FROM ecs_course_assignments ' .
81 'WHERE sid = ' . $ilDB->quote($a_server_id,
'integer');
93 public static function lookupUserIds($a_cms_id, $a_cms_sub_id, $a_obj_id)
97 $cms_sub_id_query =
'';
99 if (is_null($a_cms_sub_id)) {
100 $cms_sub_id_query =
'AND cms_sub_id IS NULL ';
102 $cms_sub_id_query =
'AND cms_sub_id = ' . $ilDB->quote($a_cms_sub_id,
'integer') .
' ';
105 $query =
'SELECT usr_id FROM ecs_course_assignments ' .
106 'WHERE cms_id = ' . $ilDB->quote($a_cms_id,
'integer') .
' ' .
108 'AND obj_id = ' . $ilDB->quote($a_obj_id,
'integer');
113 $usr_ids[] =
$row->usr_id;
130 $cms_sub_id_query =
'';
131 if (is_null($a_cms_sub_id)) {
132 $cms_sub_id_query =
'AND cms_sub_id IS NULL ';
134 $cms_sub_id_query =
'AND cms_sub_id = ' . $ilDB->quote($a_cms_sub_id,
'integer') .
' ';
137 $query =
'SELECT id FROM ecs_course_assignments ' .
138 'WHERE cms_id = ' . $ilDB->quote($a_cms_id,
'integer') .
' ' .
140 'AND obj_id = ' . $ilDB->quote($a_obj_id,
'integer') .
' ' .
141 'AND usr_id = ' . $ilDB->quote($a_usr_id,
'text');
161 $this->server = $a_server;
185 $this->cms_id = $a_id;
195 $this->cms_sub_id = $a_id;
205 $this->obj_id = $a_id;
225 $this->status = $a_status;
241 $this->
id = $ilDB->nextId(
'ecs_course_assignments');
244 $assignment = self::lookupAssignment(
251 $assignment->update();
255 $query =
'INSERT INTO ecs_course_assignments ' .
256 '(id,sid,mid,cms_id,cms_sub_id,obj_id,usr_id,status) ' .
258 $ilDB->quote($this->
getId(),
'integer') .
', ' .
259 $ilDB->quote($this->
getServer(),
'integer') .
', ' .
260 $ilDB->quote($this->
getMid(),
'integer') .
', ' .
261 $ilDB->quote($this->
getCmsId(),
'integer') .
', ' .
262 $ilDB->quote($this->
getCmsSubId(),
'integer') .
', ' .
263 $ilDB->quote($this->
getObjId(),
'integer') .
', ' .
264 $ilDB->quote($this->
getUid(),
'text') .
', ' .
265 $ilDB->quote($this->
getStatus(),
'integer') .
' ' .
267 $ilDB->manipulate(
$query);
279 $query =
'UPDATE ecs_course_assignments ' .
281 'sid = ' . $ilDB->quote($this->
getServer(),
'integer') .
', ' .
282 'mid = ' . $ilDB->quote($this->
getMid(),
'integer') .
', ' .
283 'cms_id = ' . $ilDB->quote($this->
getCmsId(),
'integer') .
', ' .
284 'cms_sub_id = ' . $ilDB->quote($this->
getCmsSubId(),
'integer') .
', ' .
285 'obj_id = ' . $ilDB->quote($this->
getObjId(),
'integer') .
', ' .
286 'usr_id = ' . $ilDB->quote($this->
getUid(),
'text') .
', ' .
287 'status = ' . $ilDB->quote($this->
getStatus(),
'integer') .
' ' .
288 'WHERE id = ' . $ilDB->quote($this->
getId(),
'integer');
289 $ilDB->manipulate(
$query);
296 public function delete()
300 $query =
'DELETE FROM ecs_course_assignments ' .
301 'WHERE id = ' . $ilDB->quote($this->
getId(),
'integer');
302 $ilDB->manipulate(
$query);
316 if (!$this->
getId()) {
320 $query =
'SELECT * FROM ecs_course_assignments ' .
321 'WHERE id = ' . $ilDB->quote($this->
getId(),
'integer');
__construct($a_id=0)
Constructor.
setServer($a_server)
Set server.
update()
Update assignemt type $ilDB.
static lookupMissingAssignmentsOfUser($a_usr_id)
Lookup missing assignments; type $ilDB.
static deleteByObjId($a_obj_id)
Delete by obj_id.
save()
Save new entry type $ilDB.
foreach($_POST as $key=> $value) $res
static lookupUserIds($a_cms_id, $a_cms_sub_id, $a_obj_id)
Lookup user ids type $ilDB.
static lookupAssignment($a_cms_id, $a_cms_sub_id, $a_obj_id, $a_usr_id)
Lookup assignment of user type $ilDB.
Create styles array
The data for the language used.
Storage of ecs course assignments.
const STATUS_LOCAL_DELETED
static deleteByServerId($a_server_id)
Delete by server id type $ilDB.