63 $this->server_id = $a_server_id;
76 if(self::$instances[$a_server_id.
'_'.
$mid])
78 return self::$instances[$a_server_id.
'_'.
$mid];
80 return self::$instances[$a_server_id.
'_'.
$mid] =
new self($a_server_id,
$mid);
105 $this->export = $a_status;
115 $this->
import = $a_status;
125 if($a_type != self::IMPORT_UNCHANGED)
127 $this->import_type = $a_type;
138 $this->title = $a_title;
153 $this->cname = $a_name;
173 $query =
'UPDATE ecs_part_settings '.
175 'sid = '.$ilDB->quote((
int) $this->
getServerId(),
'integer').
', '.
176 'mid = '.$ilDB->quote((
int) $this->
getMid(),
'integer').
', '.
177 'export = '.$ilDB->quote((
int) $this->
isExportEnabled(),
'integer').
', '.
178 'import = '.$ilDB->quote((
int) $this->
isImportEnabled(),
'integer').
', '.
179 'import_type = '.$ilDB->quote((
int) $this->
getImportType(),
'integer').
', '.
180 'title = '.$ilDB->quote($this->
getTitle(),
'text').
', '.
182 'WHERE sid = '.$ilDB->quote((
int) $this->
getServerId(),
'integer').
' '.
183 'AND mid = '.$ilDB->quote((
int) $this->
getMid(),
'integer');
184 $aff = $ilDB->manipulate(
$query);
192 $query =
'INSERT INTO ecs_part_settings '.
193 '(sid,mid,export,import,import_type,title,cname) '.
196 $ilDB->quote($this->
getMid(),
'integer').
', '.
200 $ilDB->quote($this->
getTitle(),
'text').
', '.
203 $aff = $ilDB->manipulate(
$query);
213 public function delete()
217 $query =
'DELETE FROM ecs_part_settings '.
218 'WHERE sid = '.$ilDB->quote($this->
getServerId(),
'integer').
' '.
219 'AND mid = '.$ilDB->quote($this->
getMid(),
'integer');
220 $ilDB->manipulate(
$query);
232 $query =
'SELECT * FROM ecs_part_settings '.
233 'WHERE sid = '.$ilDB->quote($this->
getServerId(),
'integer').
' '.
234 'AND mid = '.$ilDB->quote($this->
getMid(),
'integer');
238 $this->
exists = (
$res->numRows() ?
true :
false);
255 $query =
'DELETE FROM ecs_events'.
256 ' WHERE server_id = '.$ilDB->quote($a_server_id,
'integer');
257 $ilDB->manipulate(
$query);