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,
'text');
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').
' ';
85 if(!is_null($a_sub_id))
87 $query .=
'AND sub_id = '.$ilDB->quote($a_sub_id,
'text');
91 $query .=
'AND sub_id IS NULL';
107 $query =
"SELECT obj_id FROM ecs_import ".
108 "WHERE content_id = ".$ilDB->quote($a_content_id,
'integer');
115 $obj_ids[] =
$row->obj_id;
133 $query =
'SELECT * from ecs_import '.
134 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
135 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
136 'AND content_id = '.$ilDB->quote($a_content_id,
'text');
140 return $row->econtent_id;
156 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
158 $query =
"SELECT * FROM ecs_import ei JOIN object_data obd ON ei.obj_id = obd.obj_id ".
159 'WHERE server_id = '.$ilDB->quote($a_server_id).
' '.
164 $all[
$row->econtent_id] =
$row->obj_id;
167 return $all ? $all :
array();
182 $query =
"SELECT * FROM ecs_import ".
183 "WHERE mid = ".$ilDB->quote($a_mid,
'integer').
" ".
184 'AND server_id = '.$ilDB->quote($a_server_id,
'integer');
189 $obj_ids[] =
$row->obj_id;
191 return $obj_ids ? $obj_ids :
array();
206 $query =
"SELECT * FROM ecs_import WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ";
210 return $row->econtent_id;
225 $query =
'SELECT * FROM ecs_import WHERE obj_id = '.$ilDB->quote($a_obj_id,
'integer');
229 return $row->server_id;
245 $query =
"SELECT obj_id FROM ecs_import WHERE econtent_id = ".$ilDB->quote($a_econtent_id,
'text').
" ".
246 'AND server_id = '.$ilDB->quote($a_server_id,
'integer');
250 $obj_ids[] =
$row->obj_id;
252 return $obj_ids ? $obj_ids :
array();
263 public static function _lookupObjId($a_server_id,$a_econtent_id,$a_mid, $a_sub_id = null)
267 $query =
"SELECT obj_id FROM ecs_import ".
268 "WHERE econtent_id = ".$ilDB->quote($a_econtent_id,
'text').
" ".
269 "AND mid = ".$ilDB->quote($a_mid,
'integer').
" ".
270 'AND server_id = '.$ilDB->quote($a_server_id,
'integer').
' ';
272 if(!is_null($a_sub_id))
274 $query .=
'AND sub_id = '.$ilDB->quote($a_sub_id,
'text');
278 $query .=
'AND sub_id IS NULL';
299 $query =
"SELECT * FROM ecs_emport WHERE obj_id = ".$ilDB->quote($a_obj_id).
" ".
300 'AND server_id = '.$ilDB->quote($a_server_id,
'integer');
322 $query =
"SELECT mid FROM ecs_import WHERE econtent_id = ".$ilDB->quote($a_econtent_id,
'text').
" ".
323 'AND server_id = '.$ilDB->quote($a_server_id,
'integer');
329 return $mids ? $mids :
array();
344 $query =
"DELETE FROM ecs_import ".
345 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ";
359 $query =
'DELETE FROM ecs_import '.
360 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer');
361 $ilDB->manipulate(
$query);
375 $query =
'DELETE FROM ecs_import '.
376 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
377 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
378 'AND '.$ilDB->in(
'econtent_id',(
array) $a_econtent_ids,
false,
'text');
379 $ilDB->manipulate(
$query);
394 public static function _isImported($a_server_id,$a_econtent_id,$a_mid, $a_sub_id = null)
401 $this->server_id = $a_server_id;
418 $this->imported = $a_status;
423 $this->sub_id = $a_id;
428 return strlen($this->sub_id) ? $this->sub_id : NULL;
437 $this->content_id = $a_content_id;
481 $this->econtent_id = $a_id;
504 $query =
"DELETE FROM ecs_import ".
505 "WHERE obj_id = ".$this->db->quote($this->obj_id,
'integer').
" ".
506 'AND server_id = '.$ilDB->quote($this->
getServerId(),
'integer');
509 $query =
"INSERT INTO ecs_import (obj_id,mid,econtent_id,sub_id,server_id,content_id) ".
511 $this->db->quote($this->obj_id,
'integer').
", ".
512 $this->db->quote($this->mid,
'integer').
", ".
513 $this->db->quote($this->econtent_id,
'text').
", ".
514 $this->db->quote($this->
getSubId(),
'text').
', '.
515 $this->db->quote($this->
getServerId(),
'integer').
', '.
532 $query =
"SELECT * FROM ecs_import WHERE ".
533 "obj_id = ".$this->db->quote($this->obj_id,
'integer').
" ".
534 'AND server_id = '.$ilDB->quote($this->
getServerId(),
'integer');
538 $this->econtent_id =
$row->econtent_id;
539 $this->mid =
$row->mid;
540 $this->sub_id =
$row->sub_id;
541 $this->content_id =
$row->content_id;
549 $query =
'UPDATE ecs_import SET server_id = '.$ilDB->quote(0,
'integer').
550 ' WHERE server_id = '.$ilDB->quote($a_server_id,
'integer');
551 $ilDB->manipulate(
$query);
558 $this->ecs_id = $a_id;
setServerId($a_server_id)
static getAllImportedRemoteObjects($a_server_id)
get all imported links
static getPossibleRemoteTypes($a_with_captions=false)
Get all possible remote object types.
static _lookupEContentId($a_obj_id)
get econent_id
static _lookupObjId($a_server_id, $a_econtent_id, $a_mid, $a_sub_id=null)
loogup obj_id by econtent and mid and server_id
static lookupObjIdByContentId($a_server_id, $a_mid, $a_content_id, $a_sub_id=null)
Lookup obj_id by content id.
static _deleteByObjId($a_obj_id)
Delete by obj_id.
static deleteByServer($a_server_id)
Delete by server id ilDB $ilDB.
static _lookupObjIdsByMID($a_server_id, $a_mid)
lookup obj ids by mid
static resetServerId($a_server_id)
Storage of ECS imported objects.
static _isImported($a_server_id, $a_econtent_id, $a_mid, $a_sub_id=null)
check if econtent is imported for a specific mid
getEContentId()
get econtent id
static lookupEContentIdByContentId($a_server_id, $a_mid, $a_content_id)
Lookup econtent id The econtent id is the unique id from ecs.
static lookupServerId($a_obj_id)
Lookup server id of imported content <type> $ilDB.
static _lookupMIDs($a_server_id, $a_econtent_id)
Lookup mids by.
Create styles array
The data for the language used.
static lookupContentId($a_server_id, $a_mid, $a_econtent_id)
Lookup content id The content is the - not necessarily unique - id provided by the econtent type...
setImported($a_status)
Set imported.
getContentId()
get content id
static deleteRessources($a_server_id, $a_mid, $a_econtent_ids)
Delete ressources $ilDB.
setContentId($a_content_id)
Set content id.
static _lookupObjIds($a_server_id, $a_econtent_id)
Lookup obj_id.
setEContentId($a_id)
set econtent id
static _lookupMID($a_server_id, $a_obj_id)
Lookup mid.
static lookupObjIdsByContentId($a_content_id)
__construct($a_server_id, $a_obj_id)
Constructor.