46 $query =
'SELECT id FROM ecs_course_assignments ' .
47 'WHERE usr_id = ' .
$ilDB->quote($a_usr_id,
'text');
52 $assignments = array();
54 $assignments[] =
new self(
$row->id);
68 $query =
'DELETE FROM ecs_course_assignments ' .
69 'WHERE obj_id = ' .
$ilDB->quote($a_obj_id,
'integer');
86 $query =
'DELETE FROM ecs_course_assignments ' .
87 'WHERE sid = ' .
$ilDB->quote($a_server_id,
'integer');
99 public static function lookupUserIds($a_cms_id, $a_cms_sub_id, $a_obj_id)
103 $ilDB = $DIC[
'ilDB'];
105 $cms_sub_id_query =
'';
107 if (is_null($a_cms_sub_id)) {
108 $cms_sub_id_query =
'AND cms_sub_id IS NULL ';
110 $cms_sub_id_query =
'AND cms_sub_id = ' .
$ilDB->quote($a_cms_sub_id,
'integer') .
' ';
113 $query =
'SELECT usr_id FROM ecs_course_assignments ' .
114 'WHERE cms_id = ' .
$ilDB->quote($a_cms_id,
'integer') .
' ' .
116 'AND obj_id = ' .
$ilDB->quote($a_obj_id,
'integer');
121 $usr_ids[] =
$row->usr_id;
138 $ilDB = $DIC[
'ilDB'];
140 $cms_sub_id_query =
'';
141 if (is_null($a_cms_sub_id)) {
142 $cms_sub_id_query =
'AND cms_sub_id IS NULL ';
144 $cms_sub_id_query =
'AND cms_sub_id = ' .
$ilDB->quote($a_cms_sub_id,
'integer') .
' ';
147 $query =
'SELECT id FROM ecs_course_assignments ' .
148 'WHERE cms_id = ' .
$ilDB->quote($a_cms_id,
'integer') .
' ' .
150 'AND obj_id = ' .
$ilDB->quote($a_obj_id,
'integer') .
' ' .
151 'AND usr_id = ' .
$ilDB->quote($a_usr_id,
'text');
171 $this->server = $a_server;
195 $this->cms_id = $a_id;
205 $this->cms_sub_id = $a_id;
215 $this->obj_id = $a_id;
235 $this->status = $a_status;
251 $ilDB = $DIC[
'ilDB'];
253 $this->
id =
$ilDB->nextId(
'ecs_course_assignments');
256 $assignment = self::lookupAssignment(
263 $assignment->update();
267 $query =
'INSERT INTO ecs_course_assignments ' .
268 '(id,sid,mid,cms_id,cms_sub_id,obj_id,usr_id,status) ' .
270 $ilDB->quote($this->
getId(),
'integer') .
', ' .
291 $ilDB = $DIC[
'ilDB'];
293 $query =
'UPDATE ecs_course_assignments ' .
296 'mid = ' .
$ilDB->quote($this->
getMid(),
'integer') .
', ' .
297 'cms_id = ' .
$ilDB->quote($this->
getCmsId(),
'integer') .
', ' .
299 'obj_id = ' .
$ilDB->quote($this->
getObjId(),
'integer') .
', ' .
300 'usr_id = ' .
$ilDB->quote($this->
getUid(),
'text') .
', ' .
302 'WHERE id = ' .
$ilDB->quote($this->
getId(),
'integer');
310 public function delete()
314 $ilDB = $DIC[
'ilDB'];
316 $query =
'DELETE FROM ecs_course_assignments ' .
317 'WHERE id = ' .
$ilDB->quote($this->
getId(),
'integer');
332 $ilDB = $DIC[
'ilDB'];
334 if (!$this->
getId()) {
338 $query =
'SELECT * FROM ecs_course_assignments ' .
339 '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.
Storage of ecs course assignments.
const STATUS_LOCAL_DELETED
static deleteByServerId($a_server_id)
Delete by server id type $ilDB.