ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSExport Class Reference

Storage of ECS exported objects. More...

+ Collaboration diagram for ilECSExport:

Public Member Functions

 __construct ($a_obj_id)
 Constructor.
 setExported ($a_status)
 Set exported.
 isExported ()
 check if an object is exported or not
 setEContentId ($a_id)
 set econtent id
 getEContentId ()
 get econtent id
 save ()
 Save.

Static Public Member Functions

static _getAllEContentIds ()
 get all exported econtent ids
static _getExportedIDs ()
 get exported ids
static _deleteEContentIds ($a_ids)
 Delete econtent ids.
static _isRemote ($a_econtent_id)
 is remote object

Protected Attributes

 $db = null
 $obj_id = 0
 $econtent_id = 0
 $exported = false

Private Member Functions

 read ()
 Read private.

Detailed Description

Storage of ECS exported objects.

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

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

ilECSExport::__construct (   $a_obj_id)

Constructor.

public

Parameters

Definition at line 49 of file class.ilECSExport.php.

References $ilDB, and 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 ilECSExport::_deleteEContentIds (   $a_ids)
static

Delete econtent ids.

public

Parameters
arrayarray of econtent ids

Definition at line 106 of file class.ilECSExport.php.

References $ilDB, $query, and $res.

Referenced by ilECSEventQueueReader\handleImportReset(), and ilECSSettingsGUI\updateCommunities().

{
global $ilDB;
if(!is_array($a_ids) or !count($a_ids))
{
return true;
}
#$query = "DELETE FROM ecs_export WHERE econtent_id IN (".implode(',',ilUtil::quoteArray($a_ids)).')';
$query = "DELETE FROM ecs_export WHERE ".$ilDB->in('econtent_id',$a_ids,false,'integer');
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

static ilECSExport::_getAllEContentIds ( )
static

get all exported econtent ids

public

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilECSEventQueueReader\handleImportReset().

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

+ Here is the caller graph for this function:

static ilECSExport::_getExportedIDs ( )
static

get exported ids

public

Returns

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilECSContentWriter\_handleDelete(), ilECSSettingsGUI\exportReleased(), ilECSEventQueueReader\handleExportReset(), and ilECSSettingsGUI\released().

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_export ";
$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 ilECSExport::_isRemote (   $a_econtent_id)
static

is remote object

public

Parameters
intecontent_id

Definition at line 128 of file class.ilECSExport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

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

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_export ".
"WHERE econtent_id = ".$ilDB->quote($a_econtent_id,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return false;
}
return true;
}

+ Here is the caller graph for this function:

ilECSExport::getEContentId ( )

get econtent id

public

Returns
int econtent id

Definition at line 184 of file class.ilECSExport.php.

References $econtent_id.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilECSExport::isExported ( )

check if an object is exported or not

public

Definition at line 160 of file class.ilECSExport.php.

References $exported.

Referenced by save().

{
return (bool) $this->exported;
}

+ Here is the caller graph for this function:

ilECSExport::read ( )
private

Read private.

Definition at line 219 of file class.ilECSExport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by __construct().

{
global $ilDB;
$query = "SELECT * FROM ecs_export WHERE ".
"obj_id = ".$this->db->quote($this->obj_id,'integer')." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->econtent_id = $row->econtent_id;
$this->exported = true;
}
}

+ Here is the caller graph for this function:

ilECSExport::save ( )

Save.

public

Definition at line 194 of file class.ilECSExport.php.

References $ilDB, $query, $res, getEContentId(), and isExported().

{
global $ilDB;
$query = "DELETE FROM ecs_export ".
"WHERE obj_id = ".$this->db->quote($this->obj_id,'integer')." ";
$res = $ilDB->manipulate($query);
if($this->isExported())
{
$query = "INSERT INTO ecs_export (obj_id,econtent_id) ".
"VALUES ( ".
$this->db->quote($this->obj_id,'integer').", ".
$this->db->quote($this->getEContentId(),'integer')." ".
")";
$res = $ilDB->manipulate($query);
}
return true;
}

+ Here is the call graph for this function:

ilECSExport::setEContentId (   $a_id)

set econtent id

public

Parameters
intecontent id (received from ECS::addResource)

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

{
$this->econtent_id = $a_id;
}
ilECSExport::setExported (   $a_status)

Set exported.

public

Parameters
boolexport status

Definition at line 149 of file class.ilECSExport.php.

{
$this->exported = $a_status;
}

Field Documentation

ilECSExport::$db = null
protected

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

ilECSExport::$econtent_id = 0
protected

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

Referenced by getEContentId().

ilECSExport::$exported = false
protected

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

Referenced by isExported().

ilECSExport::$obj_id = 0
protected

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


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