79 $this->server_id = $a_server_id;
92 if(self::$instances[$a_server_id.
'_'.
$mid])
94 return self::$instances[$a_server_id.
'_'.
$mid];
96 return self::$instances[$a_server_id.
'_'.
$mid] =
new self($a_server_id,
$mid);
121 $this->export = $a_status;
131 $this->
import = $a_status;
141 if($a_type != self::IMPORT_UNCHANGED)
143 $this->import_type = $a_type;
154 $this->title = $a_title;
169 $this->cname = $a_name;
179 $this->token = $a_stat;
184 $this->export_types = $a_types;
194 $this->import_types = $a_types;
204 $this->dtoken = $a_stat;
229 $query =
'UPDATE ecs_part_settings '.
231 'sid = '.$ilDB->quote((
int) $this->
getServerId(),
'integer').
', '.
232 'mid = '.$ilDB->quote((
int) $this->
getMid(),
'integer').
', '.
233 'export = '.$ilDB->quote((
int) $this->
isExportEnabled(),
'integer').
', '.
234 'import = '.$ilDB->quote((
int) $this->
isImportEnabled(),
'integer').
', '.
235 'import_type = '.$ilDB->quote((
int) $this->
getImportType(),
'integer').
', '.
236 'title = '.$ilDB->quote($this->
getTitle(),
'text').
', '.
240 'export_types = '.$ilDB->quote(serialize($this->
getExportTypes()),
'text').
', '.
241 'import_types = '.$ilDB->quote(serialize($this->
getImportTypes()),
'text').
' '.
242 'WHERE sid = '.$ilDB->quote((
int) $this->
getServerId(),
'integer').
' '.
243 'AND mid = '.$ilDB->quote((
int) $this->
getMid(),
'integer');
244 $aff = $ilDB->manipulate(
$query);
252 $query =
'INSERT INTO ecs_part_settings '.
253 '(sid,mid,export,import,import_type,title,cname,token,dtoken,export_types, import_types) '.
256 $ilDB->quote($this->
getMid(),
'integer').
', '.
260 $ilDB->quote($this->
getTitle(),
'text').
', '.
267 $aff = $ilDB->manipulate(
$query);
277 public function delete()
281 $query =
'DELETE FROM ecs_part_settings '.
282 'WHERE sid = '.$ilDB->quote($this->
getServerId(),
'integer').
' '.
283 'AND mid = '.$ilDB->quote($this->
getMid(),
'integer');
284 $ilDB->manipulate(
$query);
296 $query =
'SELECT * FROM ecs_part_settings '.
297 'WHERE sid = '.$ilDB->quote($this->
getServerId(),
'integer').
' '.
298 'AND mid = '.$ilDB->quote($this->
getMid(),
'integer');
302 $this->
exists = (
$res->numRows() ?
true :
false);
324 $query =
'DELETE FROM ecs_events'.
325 ' WHERE server_id = '.$ilDB->quote($a_server_id,
'integer');
326 $ilDB->manipulate(
$query);