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

class ilEvent More...

+ Collaboration diagram for ilEventItems:

Public Member Functions

 ilEventItems ($a_event_id)
 getEventId ()
 setEventId ($a_event_id)
 getItems ()
 setItems ($a_items)
 delete ()
 _delete ($a_event_id)
 update ()
 _getItemsOfContainer ($a_ref_id)
 _isAssigned ($a_item_id)
 cloneItems ($a_source_id, $a_copy_id)
 Clone items.
 __read ()

Static Public Member Functions

static _getItemsOfEvent ($a_event_id)
 Get items by event.

Data Fields

 $ilErr
 $ilDB
 $tree
 $lng
 $event_id = null
 $items = array()

Detailed Description

class ilEvent

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
Id:
class.ilEventItems.php 15697 2008-01-08 20:04:33Z hschottm

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

Member Function Documentation

ilEventItems::__read ( )

Definition at line 203 of file class.ilEventItems.php.

References $ilDB, $res, $tree, DB_FETCHMODE_OBJECT, and getEventId().

Referenced by ilEventItems().

{
global $ilDB,$tree;
$query = "SELECT * FROM event_items ".
"WHERE event_id = ".$ilDB->quote($this->getEventId())." ";
$res = $this->db->query($query);
$this->items = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if($tree->isDeleted($row->item_id))
{
continue;
}
if(!$tree->isInTree($row->item_id))
{
$query = "DELETE FROM event_items ".
"WHERE item_id = ".$ilDB->quote($row->item_id);
$ilDB->query($query);
continue;
}
$this->items[] = (int) $row->item_id;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilEventItems::_delete (   $a_event_id)

Definition at line 82 of file class.ilEventItems.php.

References $ilDB.

Referenced by delete(), and ilObjSession\delete().

{
global $ilDB;
$query = "DELETE FROM event_items ".
"WHERE event_id = ".$ilDB->quote($a_event_id)." ";
$ilDB->query($query);
return true;
}

+ Here is the caller graph for this function:

ilEventItems::_getItemsOfContainer (   $a_ref_id)

Definition at line 108 of file class.ilEventItems.php.

References $ilDB, $in, $items, $res, $tree, DB_FETCHMODE_OBJECT, and ilUtil\quoteArray().

Referenced by ilCourseItems\getFilteredItems(), and ilContainer\getSubItems().

{
global $ilDB,$tree;
$session_nodes = $tree->getChildsByType($a_ref_id,'sess');
foreach($session_nodes as $node)
{
$session_ids[] = $node['obj_id'];
}
$in = "IN (".implode(",",ilUtil::quoteArray($session_ids)).") ";
$query = "SELECT item_id FROM event_items ".
"WHERE event_id ".$in;
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$items[] = $row->item_id;
}
return $items ? $items : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilEventItems::_getItemsOfEvent (   $a_event_id)
static

Get items by event.

public

Parameters
intevent id

Definition at line 139 of file class.ilEventItems.php.

References $ilDB, $items, $res, and DB_FETCHMODE_OBJECT.

Referenced by cloneItems().

{
global $ilDB;
$query = "SELECT * FROM event_items ".
"WHERE event_id = ".$ilDB->quote($a_event_id);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$items[] = $row->item_id;
}
return $items ? $items : array();
}

+ Here is the caller graph for this function:

ilEventItems::_isAssigned (   $a_item_id)

Definition at line 153 of file class.ilEventItems.php.

References $ilDB, and $res.

Referenced by ilCourseItems\__isMovable().

{
global $ilDB;
$query = "SELECT * FROM event_items ".
"WHERE item_id = ".$ilDB->quote($a_item_id)." ";
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}

+ Here is the caller graph for this function:

ilEventItems::cloneItems (   $a_source_id,
  $a_copy_id 
)

Clone items.

public

Parameters
intsource event id
intcopy id

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

References $ilLog, ilCopyWizardOptions\_getInstance(), _getItemsOfEvent(), setItems(), and update().

{
global $ilObjDataCache,$ilLog;
$ilLog->write(__METHOD__.': Begin cloning session materials ...');
include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
$mappings = $cwo->getMappings();
$new_items = array();
foreach(ilEventItems::_getItemsOfEvent($a_source_id) as $item_id)
{
if(isset($mappings[$item_id]) and $mappings[$item_id])
{
$ilLog->write(__METHOD__.': Clone session material nr. '.$item_id);
$new_items[] = $mappings[$item_id];
}
else
{
$ilLog->write(__METHOD__.': No mapping found for session material nr. '.$item_id);
}
}
$this->setItems($new_items);
$this->update();
$ilLog->write(__METHOD__.': Finished cloning session materials ...');
return true;
}

+ Here is the call graph for this function:

ilEventItems::delete ( )

Definition at line 77 of file class.ilEventItems.php.

References _delete(), and getEventId().

{
}

+ Here is the call graph for this function:

ilEventItems::getEventId ( )

Definition at line 57 of file class.ilEventItems.php.

References $event_id.

Referenced by __read(), delete(), and update().

{
}

+ Here is the caller graph for this function:

ilEventItems::getItems ( )

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

Referenced by ilObjSessionGUI\materialsObject().

{
return $this->items ? $this->items : array();
}

+ Here is the caller graph for this function:

ilEventItems::ilEventItems (   $a_event_id)

Definition at line 45 of file class.ilEventItems.php.

References $ilDB, $ilErr, $lng, $tree, and __read().

{
$this->ilErr =& $ilErr;
$this->db =& $ilDB;
$this->lng =& $lng;
$this->event_id = $a_event_id;
$this->__read();
}

+ Here is the call graph for this function:

ilEventItems::setEventId (   $a_event_id)

Definition at line 61 of file class.ilEventItems.php.

{
$this->event_id = $a_event_id;
}
ilEventItems::setItems (   $a_items)

Definition at line 69 of file class.ilEventItems.php.

Referenced by cloneItems(), and ilObjSessionGUI\saveMaterialsObject().

{
$this->items = array();
foreach($a_items as $item_id)
{
$this->items[] = (int) $item_id;
}
}

+ Here is the caller graph for this function:

ilEventItems::update ( )

Definition at line 92 of file class.ilEventItems.php.

References $ilDB, and getEventId().

Referenced by cloneItems().

{
global $ilDB;
$this->delete();
foreach($this->items as $item)
{
$query = "INSERT INTO event_items ".
"SET event_id = ".$ilDB->quote($this->getEventId()).", ".
"item_id = ".$ilDB->quote($item)." ";
$this->db->query($query);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilEventItems::$event_id = null

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

Referenced by getEventId().

ilEventItems::$ilDB
ilEventItems::$ilErr

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

Referenced by ilEventItems().

ilEventItems::$items = array()

Definition at line 42 of file class.ilEventItems.php.

Referenced by _getItemsOfContainer(), and _getItemsOfEvent().

ilEventItems::$lng

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

Referenced by ilEventItems().

ilEventItems::$tree

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

Referenced by __read(), _getItemsOfContainer(), and ilEventItems().


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