ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 More...
 
 setItems ($a_items)
 
 addItem ($a_item_ref_id)
 Add one item. More...
 
 delete ()
 
 _delete ($a_event_id)
 
 update ()
 
 _getItemsOfContainer ($a_ref_id)
 
 _isAssigned ($a_item_id)
 
 cloneItems ($a_source_id, $a_copy_id)
 Clone items. More...
 
 __read ()
 

Static Public Member Functions

static _getItemsOfEvent ($a_event_id)
 Get items by event. More...
 

Data Fields

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

Detailed Description

class ilEvent

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
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

◆ __read()

ilEventItems::__read ( )

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

222 {
223 global $ilDB,$tree;
224
225 $query = "SELECT * FROM event_items ".
226 "WHERE event_id = ".$ilDB->quote($this->getEventId() ,'integer')." ";
227
228 $res = $this->db->query($query);
229 $this->items = array();
230 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
231 {
232 if($tree->isDeleted($row->item_id))
233 {
234 continue;
235 }
236 if(!$tree->isInTree($row->item_id))
237 {
238 $query = "DELETE FROM event_items ".
239 "WHERE item_id = ".$ilDB->quote($row->item_id ,'integer');
240 $ilDB->manipulate($query);
241 continue;
242 }
243
244 $this->items[] = (int) $row->item_id;
245 }
246 return true;
247 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

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

Referenced by ilEventItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _delete()

ilEventItems::_delete (   $a_event_id)

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

101 {
102 global $ilDB;
103
104 $query = "DELETE FROM event_items ".
105 "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ";
106 $res = $ilDB->manipulate($query);
107 return true;
108 }

References $ilDB, $query, and $res.

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

+ Here is the caller graph for this function:

◆ _getItemsOfContainer()

ilEventItems::_getItemsOfContainer (   $a_ref_id)

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

129 {
130 global $ilDB,$tree;
131
132 $session_nodes = $tree->getChildsByType($a_ref_id,'sess');
133 foreach($session_nodes as $node)
134 {
135 $session_ids[] = $node['obj_id'];
136 }
137 $query = "SELECT item_id FROM event_items ".
138 "WHERE ".$ilDB->in('event_id',$session_ids,false,'integer');
139
140
141 $res = $ilDB->query($query);
142 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
143 {
144 $items[] = $row->item_id;
145 }
146 return $items ? $items : array();
147 }

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

Referenced by ilContainer\getSubItems(), ilObjectActivation\getTimingsItems(), ilRepositoryExplorerGUI\isNodeVisible(), ilRepositoryExplorer\isVisible(), and ilContainerGUI\redrawListItemObject().

+ Here is the caller graph for this function:

◆ _getItemsOfEvent()

static ilEventItems::_getItemsOfEvent (   $a_event_id)
static

Get items by event.

@access public

Parameters
intevent id

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

158 {
159 global $ilDB;
160
161 $query = "SELECT * FROM event_items ".
162 "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer');
163 $res = $ilDB->query($query);
164 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
165 {
166 $items[] = $row->item_id;
167 }
168 return $items ? $items : array();
169 }

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

Referenced by cloneItems().

+ Here is the caller graph for this function:

◆ _isAssigned()

ilEventItems::_isAssigned (   $a_item_id)

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

172 {
173 global $ilDB;
174
175 $query = "SELECT * FROM event_items ".
176 "WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ";
177 $res = $ilDB->query($query);
178
179 return $res->numRows() ? true : false;
180 }

References $ilDB, $query, and $res.

◆ addItem()

ilEventItems::addItem (   $a_item_ref_id)

Add one item.

Parameters
object$a_item_ref_id
Returns

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

90 {
91 $this->items[] = (int) $a_item_ref_id;
92 }

◆ cloneItems()

ilEventItems::cloneItems (   $a_source_id,
  $a_copy_id 
)

Clone items.

@access public

Parameters
intsource event id
intcopy id

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

191 {
192 global $ilObjDataCache,$ilLog;
193
194 $ilLog->write(__METHOD__.': Begin cloning session materials ...');
195
196 include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
197 $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
198 $mappings = $cwo->getMappings();
199
200 $new_items = array();
201 foreach(ilEventItems::_getItemsOfEvent($a_source_id) as $item_id)
202 {
203 if(isset($mappings[$item_id]) and $mappings[$item_id])
204 {
205 $ilLog->write(__METHOD__.': Clone session material nr. '.$item_id);
206 $new_items[] = $mappings[$item_id];
207 }
208 else
209 {
210 $ilLog->write(__METHOD__.': No mapping found for session material nr. '.$item_id);
211 }
212 }
213 $this->setItems($new_items);
214 $this->update();
215 $ilLog->write(__METHOD__.': Finished cloning session materials ...');
216 return true;
217 }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _getItemsOfEvent($a_event_id)
Get items by event.

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

+ Here is the call graph for this function:

◆ delete()

ilEventItems::delete ( )

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

96 {
97 return ilEventItems::_delete($this->getEventId());
98 }
_delete($a_event_id)

References _delete(), and getEventId().

+ Here is the call graph for this function:

◆ getEventId()

ilEventItems::getEventId ( )

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

58 {
59 return $this->event_id;
60 }

References $event_id.

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

+ Here is the caller graph for this function:

◆ getItems()

ilEventItems::getItems ( )

get assigned items

Returns
array $items Assigned items.

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

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

◆ ilEventItems()

ilEventItems::ilEventItems (   $a_event_id)

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

46 {
47 global $ilErr,$ilDB,$lng,$tree;
48
49 $this->ilErr =& $ilErr;
50 $this->db =& $ilDB;
51 $this->lng =& $lng;
52
53 $this->event_id = $a_event_id;
54 $this->__read();
55 }

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

+ Here is the call graph for this function:

◆ setEventId()

ilEventItems::setEventId (   $a_event_id)

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

62 {
63 $this->event_id = $a_event_id;
64 }

◆ setItems()

ilEventItems::setItems (   $a_items)

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

75 {
76 $this->items = array();
77 foreach($a_items as $item_id)
78 {
79 $this->items[] = (int) $item_id;
80 }
81 }

Referenced by cloneItems().

+ Here is the caller graph for this function:

◆ update()

ilEventItems::update ( )

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

111 {
112 global $ilDB;
113
114 $this->delete();
115
116 foreach($this->items as $item)
117 {
118 $query = "INSERT INTO event_items (event_id,item_id) ".
119 "VALUES( ".
120 $ilDB->quote($this->getEventId() ,'integer').", ".
121 $ilDB->quote($item ,'integer')." ".
122 ")";
123 $res = $ilDB->manipulate($query);
124 }
125 return true;
126 }

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

Referenced by cloneItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $event_id

ilEventItems::$event_id = null

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

Referenced by getEventId().

◆ $ilDB

ilEventItems::$ilDB

◆ $ilErr

ilEventItems::$ilErr

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

Referenced by ilEventItems().

◆ $items

ilEventItems::$items = array()

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

Referenced by _getItemsOfContainer(), and _getItemsOfEvent().

◆ $lng

ilEventItems::$lng

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

Referenced by ilEventItems().

◆ $tree

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: