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)
 
  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;
 
  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;
 
  253        $this->
id = 
$ilDB->nextId(
'ecs_course_assignments');
 
  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') . 
', ' .
 
  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()
 
  316        $query = 
'DELETE FROM ecs_course_assignments ' .
 
  317                'WHERE id = ' . 
$ilDB->quote($this->
getId(), 
'integer');
 
  334        if (!$this->
getId()) {
 
  338        $query = 
'SELECT * FROM ecs_course_assignments ' .
 
  339                'WHERE id = ' . 
$ilDB->quote($this->
getId(), 
'integer');
 
  347            $this->
setUid($row->usr_id);
 
An exception for terminatinating execution or to throw for unit testing.
Storage of ecs course assignments.
static lookupAssignment($a_cms_id, $a_cms_sub_id, $a_obj_id, $a_usr_id)
Lookup assignment of user @global type $ilDB.
save()
Save new entry @global type $ilDB.
static deleteByServerId($a_server_id)
Delete by server id @global type $ilDB.
__construct($a_id=0)
Constructor.
setServer($a_server)
Set server.
static lookupMissingAssignmentsOfUser($a_usr_id)
Lookup missing assignments; @global type $ilDB.
static deleteByObjId($a_obj_id)
Delete by obj_id.
static lookupUserIds($a_cms_id, $a_cms_sub_id, $a_obj_id)
Lookup user ids @global type $ilDB.
update()
Update assignemt @global type $ilDB.
const STATUS_LOCAL_DELETED
foreach($_POST as $key=> $value) $res