44 $query =
'SELECT id FROM ecs_course_assignments '.
45 'WHERE usr_id = '.$ilDB->quote($a_usr_id,
'text');
50 $assignments =
array();
53 $assignments[] =
new self(
$row->id);
65 $query =
'DELETE FROM ecs_course_assignments '.
66 'WHERE obj_id = '.$ilDB->quote($a_obj_id,
'integer');
81 $query =
'DELETE FROM ecs_course_assignments '.
82 'WHERE sid = '.$ilDB->quote($a_server_id,
'integer');
94 public static function lookupUserIds($a_cms_id, $a_cms_sub_id, $a_obj_id)
98 $cms_sub_id_query =
'';
100 if(is_null($a_cms_sub_id))
102 $cms_sub_id_query =
'AND cms_sub_id IS NULL ';
106 $cms_sub_id_query =
'AND cms_sub_id = '.$ilDB->quote($a_cms_sub_id,
'integer').
' ';
109 $query =
'SELECT usr_id FROM ecs_course_assignments '.
110 'WHERE cms_id = '.$ilDB->quote($a_cms_id,
'integer').
' '.
112 'AND obj_id = '.$ilDB->quote($a_obj_id,
'integer');
118 $usr_ids[] =
$row->usr_id;
135 $cms_sub_id_query =
'';
136 if(is_null($a_cms_sub_id))
138 $cms_sub_id_query =
'AND cms_sub_id IS NULL ';
142 $cms_sub_id_query =
'AND cms_sub_id = '.$ilDB->quote($a_cms_sub_id,
'integer').
' ';
145 $query =
'SELECT id FROM ecs_course_assignments '.
146 'WHERE cms_id = '.$ilDB->quote($a_cms_id,
'integer').
' '.
148 'AND obj_id = '.$ilDB->quote($a_obj_id,
'integer').
' '.
149 'AND usr_id = '.$ilDB->quote($a_usr_id,
'text');
170 $this->server = $a_server;
194 $this->cms_id = $a_id;
204 $this->cms_sub_id = $a_id;
214 $this->obj_id = $a_id;
234 $this->status = $a_status;
250 $this->
id = $ilDB->nextId(
'ecs_course_assignments');
253 $assignment = self::lookupAssignment(
261 $assignment->update();
265 $query =
'INSERT INTO ecs_course_assignments '.
266 '(id,sid,mid,cms_id,cms_sub_id,obj_id,usr_id,status) '.
268 $ilDB->quote($this->
getId(),
'integer').
', '.
269 $ilDB->quote($this->
getServer(),
'integer').
', '.
270 $ilDB->quote($this->
getMid(),
'integer').
', '.
271 $ilDB->quote($this->
getCmsId(),
'integer').
', '.
273 $ilDB->quote($this->
getObjId(),
'integer').
', '.
274 $ilDB->quote($this->
getUid(),
'text').
', '.
275 $ilDB->quote($this->
getStatus(),
'integer').
' '.
277 $ilDB->manipulate(
$query);
289 $query =
'UPDATE ecs_course_assignments '.
291 'sid = '.$ilDB->quote($this->
getServer(),
'integer').
', '.
292 'mid = '.$ilDB->quote($this->
getMid(),
'integer').
', '.
293 'cms_id = '.$ilDB->quote($this->
getCmsId(),
'integer').
', '.
294 'cms_sub_id = '.$ilDB->quote($this->
getCmsSubId(),
'integer').
', '.
295 'obj_id = '.$ilDB->quote($this->
getObjId(),
'integer').
', '.
296 'usr_id = '.$ilDB->quote($this->
getUid(),
'text').
', '.
297 'status = '.$ilDB->quote($this->
getStatus(),
'integer').
' '.
298 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
299 $ilDB->manipulate(
$query);
306 public function delete()
310 $query =
'DELETE FROM ecs_course_assignments '.
311 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
312 $ilDB->manipulate(
$query);
331 $query =
'SELECT * FROM ecs_course_assignments '.
332 '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.
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.