ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTimingPlaned Class Reference

class ilTimingPlaned More...

+ Collaboration diagram for ilTimingPlaned:

Public Member Functions

 ilTimingPlaned ($item_id, $a_usr_id)
 
 getUserId ()
 
 getItemId ()
 
 getPlanedStartingTime ()
 
 setPlanedStartingTime ($a_time)
 
 getPlanedEndingTime ()
 
 setPlanedEndingTime ($a_end)
 
 validate ()
 
 update ()
 
 create ()
 
 delete ()
 
 _delete ($a_item_id, $a_usr_id)
 
 _getPlanedTimings ($a_usr_id, $a_item_id)
 
 _getPlanedTimingsByItem ($a_item_id)
 
 _deleteByItem ($a_item_id)
 
 _deleteByUser ($a_usr_id)
 
 __read ()
 

Data Fields

 $ilErr
 
 $ilDB
 
 $lng
 

Detailed Description

class ilTimingPlaned

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Member Function Documentation

◆ __read()

ilTimingPlaned::__read ( )

Definition at line 179 of file class.ilTimingPlaned.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getItemId(), getUserId(), setPlanedEndingTime(), and setPlanedStartingTime().

Referenced by ilTimingPlaned().

180  {
181  global $ilDB;
182 
183  $query = "SELECT * FROM crs_timings_planed ".
184  "WHERE item_id = ".$ilDB->quote($this->getItemId() ,'integer')." ".
185  "AND usr_id = ".$ilDB->quote($this->getUserId() ,'integer')." ";
186  $res = $this->db->query($query);
187  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
188  {
189  $this->setPlanedStartingTime($row->planed_start);
190  $this->setPlanedEndingTime($row->planed_end);
191  }
192  return true;
193  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
setPlanedStartingTime($a_time)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _delete()

ilTimingPlaned::_delete (   $a_item_id,
  $a_usr_id 
)

Definition at line 118 of file class.ilTimingPlaned.php.

References $ilDB, $query, and $res.

Referenced by delete(), and update().

119  {
120  global $ilDB;
121 
122  $query = "DELETE FROM crs_timings_planed ".
123  "WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ".
124  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
125  $res = $ilDB->manipulate($query);
126  }
+ Here is the caller graph for this function:

◆ _deleteByItem()

ilTimingPlaned::_deleteByItem (   $a_item_id)

Definition at line 161 of file class.ilTimingPlaned.php.

References $ilDB, $query, and $res.

162  {
163  global $ilDB;
164 
165  $query = "DELETE FROM crs_timings_planed ".
166  "WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ";
167  $res = $ilDB->manipulate($query);
168  }

◆ _deleteByUser()

ilTimingPlaned::_deleteByUser (   $a_usr_id)

Definition at line 170 of file class.ilTimingPlaned.php.

References $ilDB, $query, and $res.

171  {
172  global $ilDB;
173 
174  $query = "DELETE FROM crs_timings_planed ".
175  "WHERE usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
176  $res = $ilDB->manipulate($query);
177  }

◆ _getPlanedTimings()

ilTimingPlaned::_getPlanedTimings (   $a_usr_id,
  $a_item_id 
)

Definition at line 129 of file class.ilTimingPlaned.php.

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

Referenced by ilObjectActivation\addAdditionalSubItemInformation().

130  {
131  global $ilDB;
132 
133  $query = "SELECT * FROM crs_timings_planed ".
134  "WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ".
135  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
136  $res = $ilDB->query($query);
137  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
138  {
139  $data['planed_start'] = $row->planed_start;
140  $data['planed_end'] = $row->planed_end;
141  }
142  return $data ? $data : array();
143  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ Here is the caller graph for this function:

◆ _getPlanedTimingsByItem()

ilTimingPlaned::_getPlanedTimingsByItem (   $a_item_id)

Definition at line 146 of file class.ilTimingPlaned.php.

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

Referenced by ilTimingCache\_getTimings().

147  {
148  global $ilDB;
149 
150  $query = "SELECT * FROM crs_timings_planed ".
151  "WHERE item_id = ".$ilDB->quote($a_item_id ,'integer')." ";
152  $res = $ilDB->query($query);
153  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
154  {
155  $data[$row->usr_id]['start'] = $row->planed_start;
156  $data[$row->usr_id]['end'] = $row->planed_end;
157  }
158  return $data ? $data : array();
159  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ Here is the caller graph for this function:

◆ create()

ilTimingPlaned::create ( )

Definition at line 99 of file class.ilTimingPlaned.php.

References $ilDB, $query, $res, getItemId(), getPlanedEndingTime(), getPlanedStartingTime(), and getUserId().

Referenced by update().

100  {
101  global $ilDB;
102 
103  $query = "INSERT INTO crs_timings_planed (item_id,usr_id,planed_start,planed_end) ".
104  "VALUES( ".
105  $ilDB->quote($this->getItemId() ,'integer').", ".
106  $ilDB->quote($this->getUserId() ,'integer').", ".
107  $ilDB->quote($this->getPlanedStartingTime() ,'integer').", ".
108  $ilDB->quote($this->getPlanedEndingTime() ,'integer')." ".
109  ")";
110  $res = $ilDB->manipulate($query);
111  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilTimingPlaned::delete ( )

Definition at line 113 of file class.ilTimingPlaned.php.

References _delete(), getItemId(), and getUserId().

114  {
115  return ilTimingPlaned::_delete($this->getItemId(),$this->getUserId());
116  }
_delete($a_item_id, $a_usr_id)
+ Here is the call graph for this function:

◆ getItemId()

ilTimingPlaned::getItemId ( )

Definition at line 58 of file class.ilTimingPlaned.php.

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

59  {
60  return $this->item_id;
61  }
+ Here is the caller graph for this function:

◆ getPlanedEndingTime()

ilTimingPlaned::getPlanedEndingTime ( )

Definition at line 71 of file class.ilTimingPlaned.php.

Referenced by create(), and validate().

72  {
73  return $this->end;
74  }
+ Here is the caller graph for this function:

◆ getPlanedStartingTime()

ilTimingPlaned::getPlanedStartingTime ( )

Definition at line 63 of file class.ilTimingPlaned.php.

Referenced by create().

64  {
65  return $this->start;
66  }
+ Here is the caller graph for this function:

◆ getUserId()

ilTimingPlaned::getUserId ( )

Definition at line 54 of file class.ilTimingPlaned.php.

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

55  {
56  return $this->user_id;
57  }
+ Here is the caller graph for this function:

◆ ilTimingPlaned()

ilTimingPlaned::ilTimingPlaned (   $item_id,
  $a_usr_id 
)

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

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

41  {
42  global $ilErr,$ilDB,$lng,$tree;
43 
44  $this->ilErr =& $ilErr;
45  $this->db =& $ilDB;
46  $this->lng =& $lng;
47 
48  $this->item_id = $item_id;
49  $this->user_id = $a_usr_id;
50 
51  $this->__read();
52  }
+ Here is the call graph for this function:

◆ setPlanedEndingTime()

ilTimingPlaned::setPlanedEndingTime (   $a_end)

Definition at line 75 of file class.ilTimingPlaned.php.

Referenced by __read().

76  {
77  $this->end = $a_end;
78  }
+ Here is the caller graph for this function:

◆ setPlanedStartingTime()

ilTimingPlaned::setPlanedStartingTime (   $a_time)

Definition at line 67 of file class.ilTimingPlaned.php.

Referenced by __read(), and ilCourseContentGUI\updateUserTimings().

68  {
69  $this->start = $a_time;
70  }
+ Here is the caller graph for this function:

◆ update()

ilTimingPlaned::update ( )

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

References _delete(), create(), getItemId(), and getUserId().

93  {
94  ilTimingPlaned::_delete($this->getItemId(),$this->getUserId());
95  $this->create();
96  return true;
97  }
_delete($a_item_id, $a_usr_id)
+ Here is the call graph for this function:

◆ validate()

ilTimingPlaned::validate ( )

Definition at line 80 of file class.ilTimingPlaned.php.

References ilObjectActivation\getItem(), getItemId(), and getPlanedEndingTime().

81  {
82  include_once './Services/Object/classes/class.ilObjectActivation.php';
83  $item = ilObjectActivation::getItem($this->getItemId());
84  // #9326
85  if($this->getPlanedEndingTime() > $item['latest_end'])
86  {
87  return false;
88  }
89  return true;
90  }
static getItem($a_ref_id)
Get item data.
+ Here is the call graph for this function:

Field Documentation

◆ $ilDB

◆ $ilErr

ilTimingPlaned::$ilErr

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

Referenced by ilTimingPlaned().

◆ $lng

ilTimingPlaned::$lng

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

Referenced by ilTimingPlaned().


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