38 $this->server_id = $a_server_id;
39 $this->obj_id = $a_obj_id;
57 $query =
'SELECT * from ecs_import '.
58 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
59 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
60 'AND econtent_id = '.$ilDB->quote($a_econtent_id,
'integer');
64 return $row->content_id;
80 $query =
"SELECT obj_id FROM ecs_import ".
81 "WHERE content_id = ".$ilDB->quote($a_content_id,
'integer').
" ".
82 "AND mid = ".$ilDB->quote($a_mid,
'integer').
" ".
83 'AND server_id = '.$ilDB->quote($a_server_id,
'integer').
' ';
87 $query .=
'AND sub_id = '.$ilDB->quote($a_sub_id,
'text');
91 $query .=
'AND sub_id IS NULL';
115 $query =
'SELECT * from ecs_import '.
116 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
117 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
118 'AND content_id = '.$ilDB->quote($a_content_id,
'text');
122 return $row->econtent_id;
138 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
140 $query =
"SELECT * FROM ecs_import ei JOIN object_data obd ON ei.obj_id = obd.obj_id ".
141 'WHERE server_id = '.$ilDB->quote($a_server_id).
' '.
146 $all[
$row->econtent_id] =
$row->obj_id;
149 return $all ? $all : array();
164 $query =
"SELECT * FROM ecs_import ".
165 "WHERE mid = ".$ilDB->quote($a_mid,
'integer').
" ".
166 'AND server_id = '.$ilDB->quote($a_server_id,
'integer');
171 $obj_ids[] =
$row->obj_id;
173 return $obj_ids ? $obj_ids : array();
188 $query =
"SELECT * FROM ecs_import WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ";
192 return $row->econtent_id;
207 $query =
'SELECT * FROM ecs_import WHERE obj_id = '.$ilDB->quote($a_obj_id,
'integer');
211 return $row->server_id;
227 $query =
"SELECT obj_id FROM ecs_import WHERE econtent_id = ".$ilDB->quote($a_econtent_id,
'integer').
" ".
228 'AND server_id = '.$ilDB->quote($a_server_id,
'integer');
232 $obj_ids[] =
$row->obj_id;
234 return $obj_ids ? $obj_ids : array();
245 public static function _lookupObjId($a_server_id,$a_econtent_id,$a_mid, $a_sub_id = NULL)
249 $query =
"SELECT obj_id FROM ecs_import ".
250 "WHERE econtent_id = ".$ilDB->quote($a_econtent_id,
'integer').
" ".
251 "AND mid = ".$ilDB->quote($a_mid,
'integer').
" ".
252 'AND server_id = '.$ilDB->quote($a_server_id,
'integer').
' ';
256 $query .=
'AND sub_id = '.$ilDB->quote($a_sub_id,
'text');
260 $query .=
'AND sub_id IS NULL';
281 $query =
"SELECT * FROM ecs_emport WHERE obj_id = ".$ilDB->quote($a_obj_id).
" ".
282 'AND server_id = '.$ilDB->quote($a_server_id,
'integer');
304 $query =
"SELECT mid FROM ecs_import WHERE econtent_id = ".$ilDB->quote($a_econtent_id,
'integer').
" ".
305 'AND server_id = '.$ilDB->quote($a_server_id,
'integer');
311 return $mids ? $mids : array();
326 $query =
"DELETE FROM ecs_import ".
327 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ";
341 $query =
'DELETE FROM ecs_import '.
342 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer');
343 $ilDB->manipulate(
$query);
357 $query =
'DELETE FROM ecs_import '.
358 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
359 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
360 'AND '.$ilDB->in(
'econtent_id',(array) $a_econtent_ids,
false,
'integer');
361 $ilDB->manipulate(
$query);
376 public static function _isImported($a_server_id,$a_econtent_id,$a_mid, $a_sub_id = 0)
383 $this->server_id = $a_server_id;
400 $this->imported = $a_status;
405 $this->sub_id = $a_id;
410 return $this->sub_id ? $this->sub_id : NULL;
419 $this->content_id = $a_content_id;
463 $this->econtent_id = $a_id;
486 $query =
"DELETE FROM ecs_import ".
487 "WHERE obj_id = ".$this->db->quote($this->obj_id,
'integer').
" ".
488 'AND server_id = '.$ilDB->quote($this->
getServerId(),
'integer');
491 $query =
"INSERT INTO ecs_import (obj_id,mid,econtent_id,sub_id,server_id,content_id) ".
493 $this->db->quote($this->obj_id,
'integer').
", ".
494 $this->db->quote($this->mid,
'integer').
", ".
495 $this->db->quote($this->econtent_id,
'integer').
", ".
496 $this->db->quote($this->
getSubId(),
'text').
', '.
497 $this->db->quote($this->
getServerId(),
'integer').
', '.
514 $query =
"SELECT * FROM ecs_import WHERE ".
515 "obj_id = ".$this->db->quote($this->obj_id,
'integer').
" ".
516 'AND server_id = '.$ilDB->quote($this->
getServerId(),
'integer');
520 $this->econtent_id =
$row->econtent_id;
521 $this->mid =
$row->mid;
522 $this->sub_id =
$row->sub_id;
523 $this->content_id =
$row->content_id;
531 $query =
'UPDATE ecs_import SET server_id = '.$ilDB->quote(0,
'integer').
532 ' WHERE server_id = '.$ilDB->quote($a_server_id,
'integer');
533 $ilDB->manipulate(
$query);
540 $this->ecs_id = $a_id;