ILIAS  Release_4_2_x_branch Revision 61807
 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_server_id, $a_obj_id)
 Constructor.
 getServerId ()
 Get server id.
 setServerId ($a_server_id)
 Set server id.
 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 _isExported ($a_obj_id)
 Check if object is exported.
static _getAllEContentIds ($a_server_id)
 get all exported econtent ids per server
static getExportedIds ()
 Get exported ids ilDB $ilDB.
static getExportServerIds ($a_obj_id)
 lookup server ids of exported materials ilDB $ilDB
static _getExportedIDsByServer ($a_server_id)
 get exported ids for server
static lookupServerIds ($a_obj_id)
 Lookup server ids of exported objects ilDB $ilDB.
static _deleteEContentIds ($a_server_id, $a_ids)
 Delete econtent ids for server.
static deleteByServer ($a_server_id)
 Delete by server id ilDB $ilDB.
static _isRemote ($a_server_id, $a_econtent_id)
 is remote object

Protected Attributes

 $db = null
 $server_id = 0
 $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_server_id,
  $a_obj_id 
)

Constructor.

public

Parameters

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

References $ilDB, and read().

{
global $ilDB;
$this->server_id = $a_server_id;
$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_server_id,
  $a_ids 
)
static

Delete econtent ids for server.

public

Parameters
arrayarray of econtent ids

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

References $ilDB, $query, and $res.

Referenced by ilECSEventQueueReader\handleExportReset().

{
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').' '.
'AND server_id = '.$ilDB->quote($a_server_id,'integer');
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

static ilECSExport::_getAllEContentIds (   $a_server_id)
static

get all exported econtent ids per server

public

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

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

Referenced by ilECSEventQueueReader\handleExportReset().

{
global $ilDB;
$query = "SELECT econtent_id,obj_id FROM ecs_export ".
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$econtent_ids[$row->econtent_id] = $row->obj_id;
}
return $econtent_ids ? $econtent_ids : array();
}

+ Here is the caller graph for this function:

static ilECSExport::_getExportedIDsByServer (   $a_server_id)
static

get exported ids for server

public

Returns

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

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

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_export ".
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$obj_ids[] = $row->obj_id;
}
return $obj_ids ? $obj_ids : array();
}
static ilECSExport::_isExported (   $a_obj_id)
static

Check if object is exported.

Parameters
int$a_obj_id
Returns
bool

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

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

Referenced by ilObjCourseGUI\fillECSExportSettings().

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

+ Here is the caller graph for this function:

static ilECSExport::_isRemote (   $a_server_id,
  $a_econtent_id 
)
static

is remote object

public

Parameters
intecontent_id

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

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

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

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_export ".
"WHERE econtent_id = ".$ilDB->quote($a_econtent_id,'integer')." ".
'AND server_id = '.$ilDB->quote($a_server_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:

static ilECSExport::deleteByServer (   $a_server_id)
static

Delete by server id ilDB $ilDB.

Parameters
int$a_server_id

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

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

{
global $ilDB;
$query = 'DELETE FROM ecs_export '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
$ilDB->manipulate($query);
}

+ Here is the caller graph for this function:

ilECSExport::getEContentId ( )

get econtent id

public

Returns
int econtent id

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

References $econtent_id.

Referenced by ilObjCourseGUI\fillECSExportSettings(), and save().

{
}

+ Here is the caller graph for this function:

static ilECSExport::getExportedIds ( )
static

Get exported ids ilDB $ilDB.

Returns
array

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

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

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

{
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::getExportServerIds (   $a_obj_id)
static

lookup server ids of exported materials ilDB $ilDB

Parameters
int$a_obj_id
Returns
array

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

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

Referenced by ilECSContentWriter\_handleDelete(), ilObjCourseGUI\fillECSExportSettings(), and ilObjCourse\updateECSContent().

{
global $ilDB;
$query = 'SELECT * FROM ecs_export '.
'WHERE obj_id = '.$ilDB->quote($a_obj_id,'integer');
$res = $ilDB->query($query);
$sids = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$sids[] = $row->server_id;
}
return $sids;
}

+ Here is the caller graph for this function:

ilECSExport::getServerId ( )

Get server id.

Returns
int

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

References $server_id.

Referenced by read(), and save().

{
}

+ Here is the caller graph for this function:

ilECSExport::isExported ( )

check if an object is exported or not

public

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

References $exported.

Referenced by save().

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

+ Here is the caller graph for this function:

static ilECSExport::lookupServerIds (   $a_obj_id)
static

Lookup server ids of exported objects ilDB $ilDB.

Parameters
<type>$a_obj_id
Returns
<type>

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

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

Referenced by ilECSReleasedContentTableGUI\parse().

{
global $ilDB;
$query = 'SELECT * FROM ecs_export '.
'WHERE obj_id = '.$ilDB->quote($a_obj_id,'integer').' ';
$res = $ilDB->query($query);
$sids = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$sids[] = $row->server_id;
}
return $sids;
}

+ Here is the caller graph for this function:

ilECSExport::read ( )
private

Read private.

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

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and getServerId().

Referenced by __construct().

{
global $ilDB;
$query = "SELECT * FROM ecs_export WHERE ".
"obj_id = ".$this->db->quote($this->obj_id,'integer')." AND ".
'server_id = '.$ilDB->quote($this->getServerId(),'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 call graph for this function:

+ Here is the caller graph for this function:

ilECSExport::save ( )

Save.

public

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

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

{
global $ilDB;
$query = "DELETE FROM ecs_export ".
"WHERE obj_id = ".$this->db->quote($this->obj_id,'integer')." ".
'AND server_id = '.$ilDB->quote($this->getServerId());
$res = $ilDB->manipulate($query);
if($this->isExported())
{
$query = "INSERT INTO ecs_export (server_id,obj_id,econtent_id) ".
"VALUES ( ".
$this->db->quote($this->getServerId(),'integer').', '.
$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 291 of file class.ilECSExport.php.

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

Set exported.

public

Parameters
boolexport status

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

{
$this->exported = $a_status;
}
ilECSExport::setServerId (   $a_server_id)

Set server id.

Parameters
int$a_server_id

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

{
$this->server_id = $a_server_id;
}

Field Documentation

ilECSExport::$db = null
protected

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

ilECSExport::$econtent_id = 0
protected

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

Referenced by getEContentId().

ilECSExport::$exported = false
protected

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

Referenced by isExported().

ilECSExport::$obj_id = 0
protected

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

ilECSExport::$server_id = 0
protected

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

Referenced by getServerId().


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