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');
 
   63            return $row->content_id;
 
   79        $query = 
"SELECT obj_id FROM ecs_import " .
 
   80            "WHERE content_id = " . 
$ilDB->quote($a_content_id, 
'integer') . 
" " .
 
   81            "AND mid = " . 
$ilDB->quote($a_mid, 
'integer') . 
" " .
 
   82            'AND server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ';
 
   84        if (!is_null($a_sub_id)) {
 
   85            $query .= 
'AND sub_id = ' . 
$ilDB->quote($a_sub_id, 
'text');
 
   87            $query .= 
'AND sub_id IS NULL';
 
  101        $query = 
"SELECT obj_id FROM ecs_import " .
 
  102            "WHERE content_id = " . 
$ilDB->quote($a_content_id, 
'integer');
 
  108            $obj_ids[] = 
$row->obj_id;
 
  126        $query = 
'SELECT * from ecs_import ' .
 
  127                'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ' .
 
  128                'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
  129                'AND content_id = ' . 
$ilDB->quote($a_content_id, 
'text');
 
  132            return $row->econtent_id;
 
  148        include_once 
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
 
  150        $query = 
"SELECT * FROM ecs_import ei JOIN object_data obd ON ei.obj_id = obd.obj_id " .
 
  151            'WHERE server_id = ' . 
$ilDB->quote($a_server_id) . 
' ' .
 
  155            $all[
$row->econtent_id] = 
$row->obj_id;
 
  158        return $all ? $all : array();
 
  173        $query = 
"SELECT * FROM ecs_import " .
 
  174            "WHERE mid = " . 
$ilDB->quote($a_mid, 
'integer') . 
" " .
 
  175            'AND server_id = ' . 
$ilDB->quote($a_server_id, 
'integer');
 
  179            $obj_ids[] = 
$row->obj_id;
 
  181        return $obj_ids ? $obj_ids : array();
 
  196        $query = 
"SELECT * FROM ecs_import WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
" ";
 
  199            return $row->econtent_id;
 
  214        $query = 
'SELECT * FROM ecs_import WHERE obj_id = ' . 
$ilDB->quote($a_obj_id, 
'integer');
 
  217            return $row->server_id;
 
  233        $query = 
"SELECT obj_id FROM ecs_import WHERE econtent_id  = " . 
$ilDB->quote($a_econtent_id, 
'text') . 
" " .
 
  234            'AND server_id = ' . 
$ilDB->quote($a_server_id, 
'integer');
 
  237            $obj_ids[] = 
$row->obj_id;
 
  239        return $obj_ids ? $obj_ids : array();
 
  250    public static function _lookupObjId($a_server_id, $a_econtent_id, $a_mid, $a_sub_id = 
null)
 
  254        $query = 
"SELECT obj_id FROM ecs_import " .
 
  255            "WHERE econtent_id = " . 
$ilDB->quote($a_econtent_id, 
'text') . 
" " .
 
  256            "AND mid = " . 
$ilDB->quote($a_mid, 
'integer') . 
" " .
 
  257            'AND server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ';
 
  259        if (!is_null($a_sub_id)) {
 
  260            $query .= 
'AND sub_id = ' . 
$ilDB->quote($a_sub_id, 
'text');
 
  262            $query .= 
'AND sub_id IS NULL';
 
  282        $query = 
"SELECT * FROM ecs_emport WHERE obj_id = " . 
$ilDB->quote($a_obj_id) . 
" " .
 
  283            'AND server_id = ' . 
$ilDB->quote($a_server_id, 
'integer');
 
  303        $query = 
"SELECT mid FROM ecs_import WHERE econtent_id = " . 
$ilDB->quote($a_econtent_id, 
'text') . 
" " .
 
  304            'AND server_id = ' . 
$ilDB->quote($a_server_id, 
'integer');
 
  309        return $mids ? $mids : array();
 
  324        $query = 
"DELETE FROM ecs_import " .
 
  325            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
" ";
 
  339        $query = 
'DELETE FROM ecs_import ' .
 
  340            'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer');
 
  355        $query = 
'DELETE FROM ecs_import ' .
 
  356                'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ' .
 
  357                'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
  358                'AND ' . 
$ilDB->in(
'econtent_id', (array) $a_econtent_ids, 
false, 
'text');
 
  374    public static function _isImported($a_server_id, $a_econtent_id, $a_mid, $a_sub_id = 
null)
 
  381        $this->server_id = $a_server_id;
 
  398        $this->imported = $a_status;
 
  403        $this->sub_id = $a_id;
 
  408        return strlen($this->sub_id) ? $this->sub_id : 
null;
 
  417        $this->content_id = $a_content_id;
 
  461        $this->econtent_id = $a_id;
 
  484        $query = 
"DELETE FROM ecs_import " .
 
  485            "WHERE obj_id = " . $this->db->quote($this->obj_id, 
'integer') . 
" " .
 
  489        $query = 
"INSERT INTO ecs_import (obj_id,mid,econtent_id,sub_id,server_id,content_id) " .
 
  491            $this->db->quote($this->obj_id, 
'integer') . 
", " .
 
  492            $this->db->quote($this->mid, 
'integer') . 
", " .
 
  493            $this->db->quote($this->econtent_id, 
'text') . 
", " .
 
  494            $this->db->quote($this->
getSubId(), 
'text') . 
', ' .
 
  495            $this->db->quote($this->
getServerId(), 
'integer') . 
', ' .
 
  512        $query = 
"SELECT * FROM ecs_import WHERE " .
 
  513            "obj_id = " . $this->db->quote($this->obj_id, 
'integer') . 
" " .
 
  517            $this->econtent_id = 
$row->econtent_id;
 
  518            $this->mid = 
$row->mid;
 
  519            $this->sub_id = 
$row->sub_id;
 
  520            $this->content_id = 
$row->content_id;
 
  528        $query = 
'UPDATE ecs_import SET server_id = ' . 
$ilDB->quote(0, 
'integer') .
 
  529            ' WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer');
 
  537        $this->ecs_id = $a_id;
 
An exception for terminatinating execution or to throw for unit testing.
Storage of ECS imported objects.
setContentId($a_content_id)
Set content id.
getContentId()
get content id
static deleteByServer($a_server_id)
Delete by server id @global ilDB $ilDB.
setEContentId($a_id)
set econtent id
setServerId($a_server_id)
static _lookupEContentId($a_obj_id)
get econent_id
static _deleteByObjId($a_obj_id)
Delete by obj_id.
static getAllImportedRemoteObjects($a_server_id)
get all imported links
read()
Read @access private.
static _lookupMID($a_server_id, $a_obj_id)
Lookup mid.
__construct($a_server_id, $a_obj_id)
Constructor.
static lookupEContentIdByContentId($a_server_id, $a_mid, $a_content_id)
Lookup econtent id The econtent id is the unique id from ecs.
static lookupObjIdsByContentId($a_content_id)
static _lookupObjIdsByMID($a_server_id, $a_mid)
lookup obj ids by mid
getEContentId()
get econtent id
static _lookupObjIds($a_server_id, $a_econtent_id)
Lookup obj_id.
static deleteRessources($a_server_id, $a_mid, $a_econtent_ids)
Delete ressources @global $ilDB.
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.
static resetServerId($a_server_id)
static _isImported($a_server_id, $a_econtent_id, $a_mid, $a_sub_id=null)
check if econtent is imported for a specific mid
static lookupServerId($a_obj_id)
Lookup server id of imported content @global <type> $ilDB.
static _lookupObjId($a_server_id, $a_econtent_id, $a_mid, $a_sub_id=null)
loogup obj_id by econtent and mid and server_id
setImported($a_status)
Set imported.
static _lookupMIDs($a_server_id, $a_econtent_id)
Lookup mids by.
static lookupObjIdByContentId($a_server_id, $a_mid, $a_content_id, $a_sub_id=null)
Lookup obj_id by content id.
static getPossibleRemoteTypes($a_with_captions=false)
Get all possible remote object types.
foreach($_POST as $key=> $value) $res