ILIAS  Release_4_0_x_branch Revision 61816
 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 ()
 get assigned items
 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 208 of file class.ilEventItems.php.

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

Referenced by ilEventItems().

{
global $ilDB,$tree;
$query = "SELECT * FROM event_items ".
"WHERE event_id = ".$ilDB->quote($this->getEventId() ,'integer')." ";
$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 ,'integer');
$ilDB->manipulate($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 87 of file class.ilEventItems.php.

References $ilDB, $query, and $res.

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

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

+ Here is the caller graph for this function:

ilEventItems::_getItemsOfContainer (   $a_ref_id)

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

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

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'];
}
$query = "SELECT item_id FROM event_items ".
"WHERE ".$ilDB->in('event_id',$session_ids,false,'integer');
$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:

static ilEventItems::_getItemsOfEvent (   $a_event_id)
static

Get items by event.

public

Parameters
intevent id

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

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

Referenced by cloneItems().

{
global $ilDB;
$query = "SELECT * FROM event_items ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer');
$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 158 of file class.ilEventItems.php.

References $ilDB, $query, and $res.

Referenced by ilCourseItems\__isMovable().

{
global $ilDB;
$query = "SELECT * FROM event_items ".
"WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ";
$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 177 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 82 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 ( )

get assigned items

Returns
array $items Assigned items.

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

Referenced by ilObjSessionGUI\createRecurringSessions(), ilObjSessionGUI\handleFileUpload(), and 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 74 of file class.ilEventItems.php.

Referenced by cloneItems(), ilObjSessionGUI\createRecurringSessions(), ilObjSessionGUI\handleFileUpload(), 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 97 of file class.ilEventItems.php.

References $ilDB, $query, $res, and getEventId().

Referenced by cloneItems().

{
global $ilDB;
$this->delete();
foreach($this->items as $item)
{
$query = "INSERT INTO event_items (event_id,item_id) ".
"VALUES( ".
$ilDB->quote($this->getEventId() ,'integer').", ".
$ilDB->quote($item ,'integer')." ".
")";
$res = $ilDB->manipulate($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: