ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSImport Class Reference

Storage of ECS imported objects. More...

+ Collaboration diagram for ilECSImport:

Public Member Functions

 __construct ($a_obj_id)
 Constructor.
 _lookupObjIds ($a_econtent_id)
 lookup obj_id
 _lookupObjId ($a_econtent_id, $a_mid)
 loogup obj_id by econtent and mid
 _lookupMID ($a_obj_id)
 Lookup mid.
 setImported ($a_status)
 Set exported.
 setMID ($a_mid)
 set mid
 getMID ()
 get mid
 setEContentId ($a_id)
 set econtent id
 getEContentId ()
 get econtent id
 save ()
 Save.

Static Public Member Functions

static _getAllImportedLinks ()
 get all imported links
static _getAll ()
 get all
static _lookupObjIdsByMID ($a_mid)
 lookup obj ids by mid
static _lookupEContentId ($a_obj_id)
 get econent_id
static _lookupMIDs ($a_econtent_id)
 Lookup mids by.
static _deleteByObjId ($a_obj_id)
 Delete by obj_id.
static _isImported ($a_econtent_id, $a_mid)
 check if econtent is imported for a specific mid

Protected Attributes

 $db = null
 $obj_id = 0
 $econtent_id = 0
 $mid = 0
 $imported = false

Private Member Functions

 read ()
 Read private.

Detailed Description

Storage of ECS imported objects.

This class stores the econent id and informations whether an object is imported or not.

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
$Id$

Definition at line 34 of file class.ilECSImport.php.

Constructor & Destructor Documentation

ilECSImport::__construct (   $a_obj_id)

Constructor.

public

Parameters

Definition at line 50 of file class.ilECSImport.php.

References read().

{
global $ilDB;
$this->obj_id = $a_obj_id;
$this->db = $ilDB;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilECSImport::_deleteByObjId (   $a_obj_id)
static

Delete by obj_id.

public

Parameters
intobj_id

Definition at line 236 of file class.ilECSImport.php.

Referenced by ilObjRemoteCourse\delete().

{
global $ilDB;
$query = "DELETE FROM ecs_import ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id)." ";
$ilDB->query($query);
return true;
}

+ Here is the caller graph for this function:

static ilECSImport::_getAll ( )
static

get all

public

Definition at line 86 of file class.ilECSImport.php.

References $res, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT * FROM ecs_import ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$all[$row->obj_id]['mid'] = $row->mid;
$all[$row->obj_id]['econtent_id'] = $row->econtent_id;
$all[$row->obj_id]['obj_id'] = $row->obj_id;
}
return $all ? $all : array();
}
static ilECSImport::_getAllImportedLinks ( )
static

get all imported links

public

Definition at line 66 of file class.ilECSImport.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilECSEventQueueReader\handleImportReset().

{
global $ilDB;
$query = "SELECT * FROM ecs_import ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$all[$row->econtent_id] = $row->obj_id;
}
return $all ? $all : array();
}

+ Here is the caller graph for this function:

static ilECSImport::_isImported (   $a_econtent_id,
  $a_mid 
)
static

check if econtent is imported for a specific mid

public

Parameters
intecontent id
intmid

Definition at line 256 of file class.ilECSImport.php.

References _lookupObjId().

Referenced by ilECSTaskScheduler\handleUpdate().

{
return ilECSImport::_lookupObjId($a_econtent_id,$a_mid);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilECSImport::_lookupEContentId (   $a_obj_id)
static

get econent_id

public

Parameters
intobj_id

Definition at line 132 of file class.ilECSImport.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilObjRemoteCourseListGUI\getCommandFrame(), ilObjRemoteCourseGUI\infoScreen(), and ilObjRemoteCourseGUI\showObject().

{
global $ilDB;
$query = "SELECT * FROM ecs_import WHERE obj_id = ".$ilDB->quote($a_obj_id)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->econtent_id;
}
return 0;
}

+ Here is the caller graph for this function:

ilECSImport::_lookupMID (   $a_obj_id)

Lookup mid.

public

Definition at line 193 of file class.ilECSImport.php.

References $res, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT * FROM ecs_emport WHERE obj_id = ".$ilDB->quote($a_obj_id)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->mid;
}
return 0;
}
static ilECSImport::_lookupMIDs (   $a_econtent_id)
static

Lookup mids by.

public

Parameters
intecontent_id

Definition at line 215 of file class.ilECSImport.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilECSTaskScheduler\handleUpdate().

{
global $ilDB;
$query = "SELECT mid FROM ecs_import WHERE econtent_id = ".$ilDB->quote($a_econtent_id)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$mids[] = $row->mid;
}
return $mids ? $mids : array();
}

+ Here is the caller graph for this function:

ilECSImport::_lookupObjId (   $a_econtent_id,
  $a_mid 
)

loogup obj_id by econtent and mid

public

Parameters
intecontent_id

Definition at line 172 of file class.ilECSImport.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by _isImported(), and ilECSTaskScheduler\handleDelete().

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_import ".
"WHERE econtent_id = ".$ilDB->quote($a_econtent_id)." ".
"AND mid = ".$ilDB->quote($a_mid)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->obj_id;
}
return 0;
}

+ Here is the caller graph for this function:

ilECSImport::_lookupObjIds (   $a_econtent_id)

lookup obj_id

public

Definition at line 151 of file class.ilECSImport.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilECSTaskScheduler\handleDelete().

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_import WHERE econtent_id = ".$ilDB->quote($a_econtent_id)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$obj_ids[] = $row->obj_id;
}
return $obj_ids ? $obj_ids : array();
}

+ Here is the caller graph for this function:

static ilECSImport::_lookupObjIdsByMID (   $a_mid)
static

lookup obj ids by mid

public

Parameters
intmid
Returns
array obj ids

Definition at line 109 of file class.ilECSImport.php.

References $res, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT * FROM ecs_import ".
"WHERE mid = ".$ilDB->quote($a_mid)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$obj_ids[] = $row->obj_id;
}
return $obj_ids ? $obj_ids : array();
}
ilECSImport::getEContentId ( )

get econtent id

public

Definition at line 314 of file class.ilECSImport.php.

References $econtent_id.

{
}
ilECSImport::getMID ( )

get mid

public

Definition at line 291 of file class.ilECSImport.php.

References $mid.

{
return $this->mid;
}
ilECSImport::read ( )
private

Read private.

Definition at line 343 of file class.ilECSImport.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by __construct().

{
$query = "SELECT * FROM ecs_import WHERE ".
"obj_id = ".$this->db->quote($this->obj_id)." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->econtent_id = $row->econtent_id;
$this->mid = $row->mid;
}
}

+ Here is the caller graph for this function:

ilECSImport::save ( )

Save.

public

Definition at line 324 of file class.ilECSImport.php.

{
$query = "DELETE FROM ecs_import ".
"WHERE obj_id = ".$this->db->quote($this->obj_id)." ";
$this->db->query($query);
$query = "INSERT INTO ecs_import ".
"SET obj_id = ".$this->db->quote($this->obj_id).", ".
"mid = ".$this->db->quote($this->mid).", ".
"econtent_id = ".$this->db->quote($this->econtent_id)." ";
$this->db->query($query);
return true;
}
ilECSImport::setEContentId (   $a_id)

set econtent id

public

Parameters
intecontent id

Definition at line 303 of file class.ilECSImport.php.

{
$this->econtent_id = $a_id;
}
ilECSImport::setImported (   $a_status)

Set exported.

public

Parameters
boolexport status

Definition at line 268 of file class.ilECSImport.php.

{
$this->imported = $a_status;
}
ilECSImport::setMID (   $a_mid)

set mid

public

Parameters
intmid

Definition at line 280 of file class.ilECSImport.php.

{
$this->mid = $a_mid;
}

Field Documentation

ilECSImport::$db = null
protected

Definition at line 36 of file class.ilECSImport.php.

ilECSImport::$econtent_id = 0
protected

Definition at line 39 of file class.ilECSImport.php.

Referenced by getEContentId().

ilECSImport::$imported = false
protected

Definition at line 41 of file class.ilECSImport.php.

ilECSImport::$mid = 0
protected

Definition at line 40 of file class.ilECSImport.php.

Referenced by getMID().

ilECSImport::$obj_id = 0
protected

Definition at line 38 of file class.ilECSImport.php.


The documentation for this class was generated from the following file: